Log In
|
Sign Up
Search
베이시스 형태소분석기가 깨진문자 때문에 분석실패할 때 회피법
Writer
이현민
Description
* 버전 : 4.11 r36786 이상 베이시스 형태소분석기에서 라이선스 제한으로 지원하지 않는 언어(일명, 깨진문자)가 섞인 문서를 처리해야 할 경우가 있습니다. 이 경우 'ERR_LICENSE_NOT_AVAILABLE'이란 메시지가 뜨면서 분석이 중단되게 되는데, 이에 대한 회피책으로 깨진문자를 임의의 문자로 대체한 후 형태소분석기를 통과시키는 방법이 있습니다. kana::utf8clean()는 원문에서 깨진문자를 지정된 대체문자로 수정합니다. 다음 코드 참고 바랍니다. 코드 (test.k) ``` #library kana // 4.12 이하 //import ksm kana // 5.0 이상 void main() { fopen('temp.fgf', 'w+b') << "<__bd__>Netflix - subtitle issue\n <__bd__>VOD Streaming ▒æ Service Failure\n <__bd__>We tried here with Brazil VPN\n"; create volume temp; use volume temp; create table tab ( fd text null ); create index i0 on tab (fd); import files . temp.fgf to tab format fd = '<__bd__>' transform fd = kana::utf8clean(fd,'?'); } ``` 테스트 ``` kql/temp> run test.k; OK kql/temp> select * from tab; ---------- 0 of total 3 (ROWID 0) --------- fd (24): Netflix - subtitle issue ---------- 1 of total 3 (ROWID 1) --------- fd (33): VOD Streaming ?æ Service Failure ---------- 2 of total 3 (ROWID 2) --------- fd (29): We tried here with Brazil VPN Total 3 records. OK ```
Tag
베이시스 basis utf8clean
Module Name
Attachments
Comments
Save
Save
Cancel
Save
Cancel
Warning
Login