Ejemplo n.º 1
0
 public Reconciler(TextNormalizerEstimator.CaseNormalizationMode textCase, bool keepDiacritics, bool keepPunctuations, bool keepNumbers)
 {
     _textCase         = textCase;
     _keepDiacritics   = keepDiacritics;
     _keepPunctuations = keepPunctuations;
     _keepNumbers      = keepNumbers;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Normalizes input text by changing case, removing diacritical marks, punctuation marks and/or numbers.
 /// </summary>
 /// <param name="input">The column to apply to.</param>
 /// <param name="textCase">Casing text using the rules of the invariant culture.</param>
 /// <param name="keepDiacritics">Whether to keep diacritical marks or remove them.</param>
 /// <param name="keepPunctuations">Whether to keep punctuation marks or remove them.</param>
 /// <param name="keepNumbers">Whether to keep numbers or remove them.</param>
 public static Scalar <string> NormalizeText(this Scalar <string> input,
                                             TextNormalizerEstimator.CaseNormalizationMode textCase = TextNormalizerEstimator.CaseNormalizationMode.Lower,
                                             bool keepDiacritics   = false,
                                             bool keepPunctuations = true,
                                             bool keepNumbers      = true) => new OutPipelineColumn(input, textCase, keepDiacritics, keepPunctuations, keepNumbers);
Ejemplo n.º 3
0
 public OutPipelineColumn(Scalar <string> input, TextNormalizerEstimator.CaseNormalizationMode textCase, bool keepDiacritics, bool keepPunctuations, bool keepNumbers)
     : base(new Reconciler(textCase, keepDiacritics, keepPunctuations, keepNumbers), input)
 {
     Input = input;
 }