2011年4月27日星期三

libhyphenate

I use libhyphenate to implement the hyphenation sucessfully. And then refer to the source code of libhyphenate.
In libhyphenate, it is easy to carry out the hyphenation.
#include <libhyphenate\Hyphenator.h>
#include <iostream>
using namespace Hyphenate;
using namespace std;
int main () {
   Hyphenator(RFC_3066::Language("en")).hyphenate("example.txt","output.txt") ;
   return 0;
}
 
the input is the txt file, and the output file is correctly in the hyphenation format. now, I read the source code of libhyphenate to find what we can refer to libhyphenate.
 
But I found one problem, the dictionary is not enough in the libhyphenate. And I replace with Webster's New International Dictionary , also have some problems, because the interface is different. 
Although the author of libhyphenate make the algorithm and the dictionary seperately, so that you can add your own dictionary to deal with your language.

没有评论:

发表评论