コード例 #1
0
 public NumberResults(INumberVerifierSettings settings,
                      List <string> sourceNumbers,
                      List <string> targetNumbers)
 {
     _settings      = settings;
     _sourceNumbers = sourceNumbers;
     _targetNumbers = targetNumbers;
 }
コード例 #2
0
        public NumberVerifierMain(INumberVerifierSettings numberVerifierSettings)
        {
            _verificationSettings = numberVerifierSettings;

            _textFormatter ??= new TextFormatter();

            _numberValidator = new NumberValidator();
        }
コード例 #3
0
        public static IEnumerable <string> GetSourceDecimalSeparators(INumberVerifierSettings numberVerifierSettings)
        {
            yield return(numberVerifierSettings.SourceDecimalComma ? @"\u002C" : string.Empty);

            yield return(numberVerifierSettings.SourceDecimalPeriod ? @"\u002E" : string.Empty);

            yield return(numberVerifierSettings.SourceDecimalCustomSeparator ? numberVerifierSettings.GetSourceDecimalCustomSeparator
                : string.Empty);
        }
コード例 #4
0
        public static IEnumerable <string> GetTargetThousandSeparators(INumberVerifierSettings numberVerifierSettings)
        {
            yield return(numberVerifierSettings.TargetThousandsSpace ? @"\u0020" : string.Empty);

            yield return(numberVerifierSettings.TargetThousandsNobreakSpace ? @"\u00A0" : string.Empty);

            yield return(numberVerifierSettings.TargetThousandsThinSpace ? @"\u2009" : string.Empty);

            yield return(numberVerifierSettings.TargetThousandsNobreakThinSpace ? @"\u202F" : string.Empty);

            yield return(numberVerifierSettings.TargetThousandsComma ? @"\u002C" : string.Empty);

            yield return(numberVerifierSettings.TargetThousandsPeriod ? @"\u002E" : string.Empty);

            yield return(numberVerifierSettings.TargetThousandsCustomSeparator
                ? numberVerifierSettings.GetTargetThousandsCustomSeparator
                : string.Empty);
        }
コード例 #5
0
        public void Verify(string sourceText, string targetText, INumberVerifierSettings settings, out NumberTexts sourceNumberTexts, out NumberTexts targetNumberTexts, List <ExcludedRange> sourceExcludedRanges = null, List <ExcludedRange> targetExcludedRanges = null)
        {
            _settings   = settings;
            _sourceText = sourceText?.Normalize(System.Text.NormalizationForm.FormKC);
            _targetText = targetText?.Normalize(System.Text.NormalizationForm.FormKC);

            if (_sourceText is null && _targetText is null)
            {
                sourceNumberTexts = null;
                targetNumberTexts = null;
                return;
            }

            _sourceThousandSeparators = GetAllowedThousandSeparators(true);
            _sourceDecimalSeparators  = GetAllowedDecimalSeparators(true).Select(Regex.Unescape).ToList();

            _targetThousandSeparators = GetAllowedThousandSeparators(false);
            _targetDecimalSeparators  = GetAllowedDecimalSeparators(false).Select(Regex.Unescape).ToList();

            _sourceNumberAreaSeparatorsList = GetSourceNumberAreaSeparators();
            _targetNumberAreaSeparatorsList = GetTargetNumberAreaSeparators();

            Verify(out sourceNumberTexts, out targetNumberTexts, sourceExcludedRanges, targetExcludedRanges);
        }
コード例 #6
0
 public static string GetHindi(INumberVerifierSettings numberVerifierSettings)
 {
     return(numberVerifierSettings.HindiNumberVerification ?
            numberVerifierSettings.GetHindi
                         : string.Empty);
 }
コード例 #7
0
 public static string GetAlphanumericsCustomSeparator(INumberVerifierSettings numberVerifierSettings)
 {
     return(numberVerifierSettings.CustomsSeparatorsAlphanumerics ?
            numberVerifierSettings.GetAlphanumericsCustomSeparator
                         : string.Empty);
 }
コード例 #8
0
 public NumberResults(INumberVerifierSettings settings, List <string> sourceNumbers, List <string> targetNumbers, string sourceText, string targetText)
     : this(settings, sourceNumbers, targetNumbers)
 {
     SourceText  = sourceText;
     _targetText = targetText;
 }
コード例 #9
0
 public NumberFormatVerifier(INumberVerifierSettings settings, ITextGenerator textGenerator)
 {
     VerificationSettings = settings;
     TextGenerator        = textGenerator;
 }
コード例 #10
0
 public NumberVerifierMain(INumberVerifierSettings numberVerifierSettings)
 {
     _verificationSettings = numberVerifierSettings;
 }
コード例 #11
0
ファイル: ExtractData.cs プロジェクト: zebraone/Sdl-Community
 public ExtractData(INumberVerifierSettings settings, IEnumerable <string> extractList)
 {
     _settings    = settings;
     _extractList = extractList;
 }