Clean up and fix

This commit is contained in:
Richard Chien
2017-02-16 09:10:56 +08:00
parent 0f7f9250c1
commit 82a0681e9f
4 changed files with 19 additions and 20 deletions

View File

@ -5,7 +5,7 @@ from nl_processor import as_processor
_query_lang_matcher = [
re.compile('(?:(?:要|[应]?该)?怎么|怎样|如何)?[把将]?[\s,.,。]?(?P<query>.*?)[\s,.,。]?'
'(?:这[个]?(?:词[组]?|句(?:子|话)?|短语))?翻译[成为到](?P<lang>\w+?[文语])(?![\s:,.。])'),
re.compile('(?P<query>.+?)[\s,.,。]?(?:这[个]?(?:词[组]?|句(?:子|话)?|短语))?(?P<lang>\w+?[文语])'),
re.compile('(?P<query>.+?)[\s,.,。]?(?:这[个]?(?:词[组]?|句(?:子|话)?|短语))?[的用](?P<lang>\w+?[文语])'),
re.compile('.*?[把将]?(?:(?:[下后][面])?(?:这[个]?|[下后][面]?)(?:词[组]?|句(?:子|话)?|短语))?'
'翻译[成为到]\s*(?P<lang>\w+?[文语])[\s:,](?P<query>.*)'),
re.compile('.*[用]?(?P<lang>\w+?[文语])\w*?(?:说|讲|表达|表示)'