Le 30 septembre 2010 13:51:19 UTC+2, Németh László <[email protected]> a écrit :
> Hi, > > You have to change the flag in affix rules, too: > > > SFX S 0 a/P . -> > > SFX S 0 a/1 . > > László, Sorry to bother you a bit more. The suggestion sounds not to work. Correct me if I am wrong. I found another reference here: http://www.goranrakic.com/tmp/hunspell.pdf(check under GENERAL OPTIONS), which explains this way: AF number_of_flag_vector_aliases AF flag_vector Hunspell can substitute affix flag sets with ordinal numbers in affix rules (alias compression, see makealias tool). First example with alias compression: 3 hello try/1 work/2 AF definitions in the affix file: SET UTF-8 TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ AF 2 AF A AF AB It is equivalent of the following dic file: 3 hello try/A work/AB Now, Given: # every word must have at least a suffix AF 1 AF SN # more compression aliases will be added later # prefix section PFX P Y 4 PFX P 0 a . PFX P 0 achi . PFX P 0 adza . PFX P 0 adzachi . #suffix section SFX S Y 3 SFX S 0 a/P . SFX S 0 abe/P . SFX S 0 eno/P . Looking critically at the solution you gave ( changing SFX S 0 a/P . to SFX S 0 a/1 . ), the suffix sounds to self-referencing. May be you may shade more light on this one (with reference to this source or otherwise), or or point me to a better tutorial on AF flags. --- Edmond Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) | Malawi Cell: +265 999 465 137 | +265 881 234 717 *"Many people doubt open source software and probably don’t realize that there is an alternative… which is just as good.." -- Kevin Scannell* 2010/9/30 Edmond Kachale <[email protected]> > > Hi there, >> >> I have two files ny_MW.aff and ny_MW.dic. In ny_MW.dic, there are words >> that MUST have at least a suffix S but may also take a prefix P. In order to >> enforce suffixation on those words, I declare a virtual stemming flag >> NEEDAFFIX N that is appended to them. I have prefixes defined like this one >> "PFX P 0 achi .", and and suffixes define like this "SFX S 0 abe/P .". >> >> Given the following words: >> batiz >> abatiz >> batiza >> achibatiza >> I expect the following result: >> batiz (WRONG) >> abatiz (WRONG) >> batiza (CORRECT) >> achibatiza (CORRECT) >> >> I prefer defining the affix class combinations using AF flag because of >> the number of affix classes to be used. However, AF flag doesn't seem to >> work fine for me. Does anyone know why the affix class combination works >> fine without using AF flag, and why it does not work when using AF flag? >> (c.f. case A and case B below). If so, how can I improve AF flagging (case >> B) to work fine? >> >> CASE A: Without AF flag >> =================== >> >> 1. ny_MW.aff >> >> SET ISO8859-14 >> TRY aiuneorbkmgywthszdc' >> IjAvfUpRKMNlBGLPYHTCSDZEWVJO >> >> WORDCHARS -' >> CIRCUMFIX M >> NEEDAFFIX N >> >> # prefix section >> PFX P Y 4 >> PFX P 0 a . >> PFX P 0 achi . >> PFX P 0 adza . >> PFX P 0 adzachi . >> >> #suffix section >> SFX S Y 5 >> SFX S 0 a/P . >> SFX S 0 abe/P . >> SFX S 0 eno/P . >> SFX S 0 ko . >> SFX S 0 po . >> >> 2. ny_MW.dic >> batiz/SN >> mlimi >> yang'an/SN >> >> CASE B: Using AF flag ( This one does not work) >> ==================================== >> >> 1. ny_MW.aff >> >> SET ISO8859-14 >> TRY aiuneorbkmgywthszdc'IjAvfUpRKMNlBGLPYHTCSDZEWVJO >> >> WORDCHARS -' >> CIRCUMFIX M >> NEEDAFFIX N >> >> # every word must have at least a suffix >> AF 1 >> AF SN >> # more compression aliases will be added later >> >> # prefix section >> PFX P Y 4 >> PFX P 0 a . >> PFX P 0 achi . >> PFX P 0 adza . >> PFX P 0 adzachi . >> >> #suffix section >> SFX S Y 3 >> SFX S 0 a/P . >> SFX S 0 abe/P . >> SFX S 0 eno/P . >> >> 2. ny_MW.dic >> batiz/1 >> mlimi >> yang'an/1 >> >> I'm using these references: >> >> - http://manpages.ubuntu.com/manpages/dapper/man4/hunspell.4.html >> - http://pwet.fr/man/linux/fichiers_speciaux/hunspell >> >> *Sorry for sending a longer email. May be I would use pastie/pastebin. [?] >> . >> >> * >> --- >> Edmond >> Software Developer | Baobab Health Trust (http://www.baobabhealth.org/) | >> Malawi >> >> Cell: +265 999 465 137 | +265 881 234 717 >> >> *"Many people doubt open source software and probably don’t realize that >> there is an alternative… which is just as good.." -- Kevin Scannell* >> >> >
