Skip to content

Commit

Permalink
Merge pull request #3 from DanialLiu/master
Browse files Browse the repository at this point in the history
speed up build_corpus.py 100 times
  • Loading branch information
Kyubyong committed Nov 29, 2017
2 parents dfe7d61 + 8c57fd1 commit 132cc62
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build_corpus.py
Expand Up @@ -19,15 +19,16 @@
import regex # pip install regex
from xpinyin import Pinyin # pip install xpinyin

pinyin = Pinyin()

def align(sent):
'''
Args:
sent: A string. A sentence.
Returns:
A tuple of pinyin and chinese sentence.
'''
pinyin = Pinyin()
'''
pnyns = pinyin.get_pinyin(sent, " ").split()

hanzis = []
Expand Down

0 comments on commit 132cc62

Please sign in to comment.