@@ -54,8 +54,8 @@ internal sealed class Column : ManyToOneColumn
5454
5555 [ Argument ( ArgumentType . AtMostOnce ,
5656 HelpText = "Whether to include all ngram lengths up to " + nameof ( NgramLength ) + " or only " + nameof ( NgramLength ) ,
57- ShortName = "all" ) ]
58- public bool ? AllLengths ;
57+ Name = "AllLengths" , ShortName = "all" ) ]
58+ public bool ? UseAllLengths ;
5959
6060 [ Argument ( ArgumentType . Multiple , HelpText = "Maximum number of ngrams to store in the dictionary" , ShortName = "max" ) ]
6161 public int [ ] MaxNumTerms = null ;
@@ -76,7 +76,7 @@ internal static Column Parse(string str)
7676 internal bool TryUnparse ( StringBuilder sb )
7777 {
7878 Contracts . AssertValue ( sb ) ;
79- if ( NgramLength != null || SkipLength != null || AllLengths != null || Utils . Size ( MaxNumTerms ) > 0 ||
79+ if ( NgramLength != null || SkipLength != null || UseAllLengths != null || Utils . Size ( MaxNumTerms ) > 0 ||
8080 Weighting != null )
8181 {
8282 return false ;
@@ -123,7 +123,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
123123 MaxNumTerms = options . MaxNumTerms ,
124124 NgramLength = options . NgramLength ,
125125 SkipLength = options . SkipLength ,
126- AllLengths = options . AllLengths ,
126+ UseAllLengths = options . UseAllLengths ,
127127 Weighting = options . Weighting ,
128128 Columns = new NgramExtractorTransform . Column [ options . Columns . Length ]
129129 } ;
@@ -146,7 +146,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
146146 NgramLength = column . NgramLength ,
147147 SkipLength = column . SkipLength ,
148148 Weighting = column . Weighting ,
149- AllLengths = column . AllLengths
149+ UseAllLengths = column . UseAllLengths
150150 } ;
151151 }
152152
@@ -175,8 +175,9 @@ internal sealed class Column : OneToOneColumn
175175 public int ? SkipLength ;
176176
177177 [ Argument ( ArgumentType . AtMostOnce , HelpText =
178- "Whether to include all ngram lengths up to " + nameof ( NgramLength ) + " or only " + nameof ( NgramLength ) , ShortName = "all" ) ]
179- public bool ? AllLengths ;
178+ "Whether to include all ngram lengths up to " + nameof ( NgramLength ) + " or only " + nameof ( NgramLength ) ,
179+ Name = "AllLengths" , ShortName = "all" ) ]
180+ public bool ? UseAllLengths ;
180181
181182 // REVIEW: This argument is actually confusing. If you set only one value we will use this value for all ngrams respectfully for example,
182183 // if we specify 3 ngrams we will have maxNumTerms * 3. And it also pick first value from this array to run term transform, so if you specify
@@ -200,7 +201,7 @@ internal static Column Parse(string str)
200201 internal bool TryUnparse ( StringBuilder sb )
201202 {
202203 Contracts . AssertValue ( sb ) ;
203- if ( NgramLength != null || SkipLength != null || AllLengths != null || Utils . Size ( MaxNumTerms ) > 0 ||
204+ if ( NgramLength != null || SkipLength != null || UseAllLengths != null || Utils . Size ( MaxNumTerms ) > 0 ||
204205 Weighting != null )
205206 {
206207 return false ;
@@ -225,11 +226,11 @@ internal abstract class ArgumentsBase
225226
226227 [ Argument ( ArgumentType . AtMostOnce ,
227228 HelpText = "Whether to include all ngram lengths up to " + nameof ( NgramLength ) + " or only " + nameof ( NgramLength ) ,
228- ShortName = "all" ) ]
229- public bool AllLengths = NgramExtractingEstimator . Defaults . AllLengths ;
229+ Name = "AllLengths" , ShortName = "all" ) ]
230+ public bool UseAllLengths = NgramExtractingEstimator . Defaults . UseAllLengths ;
230231
231232 [ Argument ( ArgumentType . Multiple , HelpText = "Maximum number of ngrams to store in the dictionary" , ShortName = "max" ) ]
232- public int [ ] MaxNumTerms = new int [ ] { NgramExtractingEstimator . Defaults . MaxNumTerms } ;
233+ public int [ ] MaxNumTerms = new int [ ] { NgramExtractingEstimator . Defaults . MaximumNgramsCount } ;
233234
234235 [ Argument ( ArgumentType . AtMostOnce , HelpText = "The weighting criteria" ) ]
235236 public NgramExtractingEstimator . WeightingCriteria Weighting = NgramExtractingEstimator . Defaults . Weighting ;
@@ -315,7 +316,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
315316 termArgs =
316317 new ValueToKeyMappingTransformer . Options ( )
317318 {
318- MaxNumTerms = Utils . Size ( options . MaxNumTerms ) > 0 ? options . MaxNumTerms [ 0 ] : NgramExtractingEstimator . Defaults . MaxNumTerms ,
319+ MaxNumTerms = Utils . Size ( options . MaxNumTerms ) > 0 ? options . MaxNumTerms [ 0 ] : NgramExtractingEstimator . Defaults . MaximumNgramsCount ,
319320 Columns = new ValueToKeyMappingTransformer . Column [ termCols . Count ]
320321 } ;
321322 }
@@ -347,7 +348,7 @@ internal static IDataTransform Create(IHostEnvironment env, Options options, IDa
347348 ngramColumns [ iinfo ] = new NgramExtractingEstimator . ColumnOptions ( column . Name ,
348349 column . NgramLength ?? options . NgramLength ,
349350 column . SkipLength ?? options . SkipLength ,
350- column . AllLengths ?? options . AllLengths ,
351+ column . UseAllLengths ?? options . UseAllLengths ,
351352 column . Weighting ?? options . Weighting ,
352353 column . MaxNumTerms ?? options . MaxNumTerms ,
353354 isTermCol [ iinfo ] ? column . Name : column . Source
@@ -380,7 +381,7 @@ internal static IDataTransform Create(IHostEnvironment env, NgramExtractorArgume
380381 Columns = extractorCols ,
381382 NgramLength = extractorArgs . NgramLength ,
382383 SkipLength = extractorArgs . SkipLength ,
383- AllLengths = extractorArgs . AllLengths ,
384+ UseAllLengths = extractorArgs . UseAllLengths ,
384385 MaxNumTerms = extractorArgs . MaxNumTerms ,
385386 Weighting = extractorArgs . Weighting
386387 } ;
0 commit comments