protected override bool IsAPossibleMatch(AddressPartResult match) { var streetType = parsedAddress.StreetType; var patternMatches = MatchesDirection(match.Value); var twoBeforeStreetType = match.IsAtLeastNBefore(2, streetType); if (patternMatches && twoBeforeStreetType) { return(true); } else { return(false); } }
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); } }
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); } }
public static bool IsBefore( this AddressPartResult firstPart, AddressPartResult secondPart) { return(firstPart.IsAtLeastNBefore(1, secondPart)); }