많은 단어가 시끄러운 단어 목록이 있습니다. 시끄럽다는 것은 ' "', '-'와 같은 알파벳이 아닌 문자로 시작한다는 것을 의미합니다. 예 :"thisword, -thisword,- "this word, .thisword 및 다른 여러 단어가 될 수 있습니다.
ascii를 사용하여 제거 할 수 있습니다.
from string import ascii letter
string.lstrip(ascii_letters)
정규 표현식을 사용하지 않고 non_ascii를 처리 할 수있는 유사한 방법이 파이썬에 있습니까?
감사!
string.puctuation 을 사용하지 않는 이유
>>> from string import punctuation
>>> "-asdf".lstrip(punctuation)
'asdf'
>>> "'asdf".lstrip(punctuation)
'asdf'
>>> '"asdf'.lstrip(punctuation)
'asdf'
>>> ',asdf'.lstrip(punctuation)
'asdf'
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다