Использование faind

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import ctypes
from ctypes import *
words = [u"КОШАЧЬЕГО", u"РОБОТСКОГО", u"БЕЗУМНЫМ", u"САШКИНОГО"]
faind_dll = windll.LoadLibrary("faind.win32.dll")
hengine = faind_dll.sol_CreateGrammarEngineA("bin\\dictionary.xml")
for w in words:
wbuff = create_unicode_buffer( w, 100)
if faind_dll.sol_TranslateToBase( hengine, wbuff, False ) == 1:
print wbuff.value
faind_dll.sol_DeleteGrammarEngine( hengine )