do_ocr_word_mlp或者do_ocr_word_svm识别字符串错误并使用词典纠正方法
- *创建词典
- create_lexicon ('months', ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'], Months)
- * 查找一个正确的单词
- lookup_lexicon (Months, 'may', Found)
- * 没有找到情况下
- lookup_lexicon (Months, 'nay', Found)
- * 注意! 词典是大小写敏感的.
- lookup_lexicon (Months, 'May', Found)
- * 查找最接近匹配并纠正成正常单词
- suggest_lexicon (Months, 'nay', Suggestion, NumCorrections)
- suggest_lexicon (Months, 'mya', Suggestion, NumCorrections)
- suggest_lexicon (Months, 'nya', Suggestion, NumCorrections)
- suggest_lexicon (Months, 'jyna', Suggestion, NumCorrections)
- * 读取词典内容
- inspect_lexicon (Months, Words)
复制代码 本例子用于识别错误情况下,将自动替换成正确的内置单词。
该例子在halcon22.11.2.0测试通过
|