private bool IsAPossibleMatch(AddressPartResult match)
        {
            SetInstanceVariablesFromContainer();

            var isAlphabetic     = IsAlphabetic(match.Value);
            var afterStreetType  = match.IsAfter(streetType);
            var afterDir         = directionalSuffix.IsNotSet() || match.IsAfter(directionalSuffix);
            var afterUnitType    = unitType.IsNotSet() || match.IsAtLeastNAfter(2, unitType);
            var beforeState      = state.IsNotSet() || match.IsBefore(state);
            var beforePostalCode = postalCode.IsNotSet() || match.IsBefore(postalCode);

            if (isAlphabetic &&
                afterStreetType &&
                afterDir &&
                afterUnitType &&
                beforeState &&
                beforePostalCode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        private bool IsAPossibleMatch(AddressPartResult match)
        {
            SetInstanceVariablesFromContainer();

            //var isAlphabetic = IsAlphabetic(match.Value);
            var isAlphaNumeric           = IsNumericOrAlphaNumeric(match.Value);
            var isOneOrTwoLetters        = IsOneOrTwoLetters(match.Value);
            var isHyphenatedAlphaNumeric = IsHyphenatedAlphaNumeric(match.Value);
            var afterStreetType          = match.IsAfter(streetType);
            var afterDir         = directionalSuffix.IsNotSet() || match.IsAfter(directionalSuffix);
            var afterUnitType    = unitType.IsNotSet() || match.IsAfter(unitType);
            var beforeState      = state.IsNotSet() || match.IsBefore(state);
            var beforePostalCode = postalCode.IsNotSet() || match.IsBefore(postalCode);

            if ((isAlphaNumeric || isOneOrTwoLetters || isHyphenatedAlphaNumeric) &&
                afterStreetType &&
                afterDir &&
                afterUnitType &&
                beforeState &&
                beforePostalCode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
        private bool IsAPossibleMatch(AddressPartResult match)
        {
            var streetType  = parsedAddress.StreetType;
            var number      = parsedAddress.Number;
            var fraction    = parsedAddress.NumberFraction;
            var directional = parsedAddress.DirectionalPrefix;

            var alphabetic       = IsAlphabetic(match.Value);
            var ordinal          = IsNumberOrdinal(match.Value);
            var beforeStreetType = match.IsBefore(streetType);
            var afterNumber      = match.IsAfter(number);
            var afterFraction    = fraction.IsNotSet() || match.IsAfter(fraction);
            var afterDir         = directional.IsNotSet() || match.IsAfter(directional);

            if ((alphabetic || ordinal) &&
                beforeStreetType &&
                afterNumber &&
                afterFraction &&
                afterDir)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private bool IsAPossibleMatch(AddressPartResult match)
        {
            SetInstanceVariablesFromContainer();

            var isFourDigits  = IsFourDigits(match.Value);
            var afterPostCode = match.IsAfter(postalCode);

            if (isFourDigits && afterPostCode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #5
0
        private bool IsAPossibleMatch(AddressPartResult match)
        {
            SetInstanceVariablesFromContainer();

            var isFraction          = IsFraction(match.Value);
            var afterNumber         = match.IsAfter(number);
            var twoBeforeStreetType = match.IsAtLeastNBefore(2, streetType);

            if (isFraction && afterNumber && twoBeforeStreetType)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #6
0
        protected override bool IsAPossibleMatch(AddressPartResult match)
        {
            SetInstanceVariablesFromContainer();

            bool patternMatches   = MatchesDirection(match.Value);
            bool afterStreetType  = match.IsAfter(streetType);
            bool beforeState      = state.IsNotSet() || match.IsAtLeastNBefore(2, state);
            bool beforePostalCode = postalCode.IsNotSet() || match.IsBefore(postalCode);
            bool beforeUnitType   = unitType.IsNotSet() || match.IsBefore(unitType);

            if (patternMatches && afterStreetType && beforeState && beforePostalCode && beforeUnitType)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #7
0
 private bool IsAfterStreetType(AddressPartResult part)
 {
     return(part.IsAfter(parsedAddress.StreetType));
 }
 private bool IsInCorrectLocation(AddressPartResult part)
 {
     return(part.IsAfter(parsedAddress.StreetType) &&
            (parsedAddress.UnitType.IsNotSet() ||
             part.IsAtLeastNAfter(2, parsedAddress.UnitType)));
 }