@@ -662,28 +662,6 @@ def _parse_and_verify(self, candidate, offset):
662662 return None
663663
664664 numobj = parse (candidate , self .preferred_region , keep_raw_input = True )
665- # Check Israel * numbers: these are a special case in that they
666- # are four-digit numbers that our library supports, but they can
667- # only be dialled with a leading *. Since we don't actually store
668- # or detect the * in our phone number library, this means in
669- # practice we detect most four digit numbers as being valid for
670- # Israel. We are considering moving these numbers to
671- # ShortNumberInfo instead, in which case this problem would go
672- # away, but in the meantime we want to restrict the false matches
673- # so we only allow these numbers if they are preceded by a
674- # star. We enforce this for all leniency levels even though these
675- # numbers are technically accepted by isPossibleNumber and
676- # isValidNumber since we consider it to be a deficiency in those
677- # methods that they accept these numbers without the *.
678- # TODO: Remove this or make it significantly less hacky once we've
679- # decided how to handle these short codes going forward in
680- # ShortNumberInfo. We could use the formatting rules for instance,
681- # but that would be slower.
682- if (region_code_for_country_code (numobj .country_code ) == "IL" and
683- len (national_significant_number (numobj )) == 4 and
684- (offset == 0 or (offset > 0 and self .text [offset - 1 ] != U_STAR ))): # pragma no cover
685- # No match.
686- return None
687665 if _verify (self .leniency , numobj , candidate ):
688666 # We used parse(keep_raw_input=True) to create this number,
689667 # but for now we don't return the extra values parsed.
0 commit comments