Skip to content

Instantly share code, notes, and snippets.

@giftbott
Last active October 10, 2016 15:24
Show Gist options
  • Select an option

  • Save giftbott/a85d41ae016cd3eb501d09d8747ad8cc to your computer and use it in GitHub Desktop.

Select an option

Save giftbott/a85d41ae016cd3eb501d09d8747ad8cc to your computer and use it in GitHub Desktop.
한글로 된 숫자를 진짜 숫자로 변환해주는 전처리 함수
def get_preprocessed_number(number):
preprocess_dict = {
"-": "",
":": "",
".": "",
"영": "0",
"공": "0",
"일": "1",
"하나": "1",
"둘": "2",
"이": "2",
"셋": "3",
"삼": "3",
"사": "4",
"넷": "4",
"다섯": "5",
"오": "5",
"육": "6",
"륙": "6",
"여섯": "6",
"칠": "7",
"일곱": "7",
"팔": "8",
"여덟": "8",
"아홉": "9",
"구": "9",
}
for key, value in preprocess_dict.items():
number = number.replace(key, value)
return number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment