파이썬 버전의 Google libphonenumbers를 사용하고 있습니다.하지만 다른 텍스트에서이 라이브러리를 사용해 보았을 때 파이썬 함수가 나에게 아무것도 반환하지 않을 때가 있습니다. 거기 전화 번호가 있고 때로는 그들이 전화 번호를 반환합니다. 아래를 참조하십시오 :파이썬 : libphonenumber - 명백한 전화 번호를 추출 할 수 없습니다
print(x2)
for match in pnum.PhoneNumberMatcher(x2, "US"):
print(match) #for the text above, it did not get the number
출력 :
I just read your profile and thought it was really great. I also thought you were cute and loved the fact that you go hiking with your brothers every summer. If you want to know anything more about me, just ask. My num 555-121-5468.
이상이 텍스트로를, 그것은 나에게 어떤 전화 번호를 반환하지 않습니다. 그러나 다음과 같은 다른 상황에서,이 기능은 나에게 올바른 입력 제공 :
이x9 = "hay I hate to cut you short, its been fun chatting, but unfortuantely I gotta run. I am gald we became friends though. my number is (323) 2387890"
for match in pnum.PhoneNumberMatcher(x9, "US"):
print(match)
출력 : 나는 문제가이 문제를 일으키는 모르는
PhoneNumberMatch [132,145) (323) 2387890
, 내가 파이썬에 새로운 오전을 이 도서관은 통찰력을 진심으로 감사 할 것입니다.