Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def demo1():
for i in text:
print(i, pycorrector.detect(i))
print(i, pycorrector.correct(i))
' ',
'这是人工智能的一个分知',
'我的家乡是有名的玉米之乡',
'老师工作非常幸苦,我们要遵敬老师',
'nihao, 耐得住欲妄',
'一阙词牌名',
'我兴高彩列地去公园游玩',
'吹唐人记忆',
' 耐得住欲妄',
'母子平爱',
'不由的感叹道',
]
error_sentences.extend(text_list)
for line in error_sentences:
print(pycorrector.detect(line))
correct_sent = pycorrector.correct(line)
print("original sentence:{} => correct sentence:{}".format(line, correct_sent))
def test1():
for i in text:
print(i, pycorrector.detect(i))
print(i, pycorrector.correct(i))
def test2():
for i in x:
print(i, pycorrector.detect(i))
print(i, pycorrector.correct(i))
def demo2():
for i in x:
print(i, pycorrector.detect(i))
print(i, pycorrector.correct(i))
'天地无垠大,我们的舞台无线大',
'交通先行了怎么过去啊?',
]
for line in error_sentences:
idx_errors = pycorrector.detect(line)
print(idx_errors)
correct_sent = pycorrector.correct(line)
print("original sentence:{} => correct sentence:{}".format(line, correct_sent))
print('*' * 53)
pycorrector.set_custom_confusion_dict(path='./my_confusion.txt')
pycorrector.set_custom_word(path='./my_custom_word.txt')
for line in error_sentences:
idx_errors = pycorrector.detect(line)
print(idx_errors)
correct_sent = pycorrector.correct(line)
print("original sentence:{} => correct sentence:{}".format(line, correct_sent))
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
import sys
sys.path.append("../")
import pycorrector
idx_errors = pycorrector.detect('少先队员因该为老人让坐')
print(idx_errors)