Word correction library for c++ - c++

Are there any open-source word correction for c++? I would like to integrate with my c++ program to fix when OCR read some characters wrongly at some positions of the whole word. For example if the OCR output is "Recoqnitl0n" the program will correct it and convert to "Recognition".
Thank you

Yes, there are some open source spell checkers. Try:
hunspell
or
aspell

Related

printing japanese characters in pdf using libharu

Currently I am using libharu to create pdf file. In the file I have some Japanese characters and they are saving as utf-8 first.
After that, I am using HPDF_UseJPEncodings(m_pdf), HPDF_UseJPFonts(m_pdf) and m_fontStandard = HPDF_GetFont(m_pdf, "MS-Mincho", "90msp-RKSJ-H") to encode.
However, 90msp-RKSJ-H is cmap and not for utf-8, does anyone know how to convert utf-8 to cmap for 90msp-RKSJ-H?
Thank you
Hey why dont you refer Libharu's support group on google.
Here's the link for the code you want.
https://groups.google.com/forum/?fromgroups=#!topic/libharu/YzXoH_K3OAI
I hope it solves your purpose.

How to program a spinning cursor in c++ on OSX?

I need a progress indicator in the form of a spinning cursor for a command line program. I read a couple of threads with the advice of using the backspace character \b to delete the last printed character. However, when using \b with cout on OSX, the result is some UTF-8 character (an upside-down question mark).
Does anyone know if there is a way to get this problem solved with standard c++ means?
You can use the ncurses library for cross-platform terminal access. You csn make nice text-only UIs using this.

word to syllable converter

I am writing a piece of code in c++ where in i need a word to syllable converter is there any open source standard algorithm available or any other links which can help me build one.
for a word like invisible syllable would be in-viz-uh-ble
it should be ideally be able to even parse complex words like "invisible".
I already found a link for algorithm in perl and python but i want to know if any library is available in c++
Thanks a lot.
Your example shows a phonetic representation of the word, not simply a split into syllables. This is a complex NLP issue.
Take a look at soundex and metaphone. There are C/C++ implementation for both.
Also many dictionaries provide the IPA notation of words. Take a look a Wiktionary API.
For detecting syllables in words, you could adapt a project of mine to your needs.
It's called tinyhyphenator.
It gives you an integer list of all possible hyphenation indices within a word. For German it renders quite exactly. You would have to obtain the index list and insert the hyphens yourself.
By "adapt" I mean adding the specification of English syllables. Take a look at the source code, it is supposed to be quite self explanatory.

Suggestions for Creating an Image for Each Word in a Text

I am looking for a way to automatically create an image rendering for each word in a text file (I am working on an "easy" way to display a complex script on computers and cell phones that don't support the complex script). Is there an easy way to do something like this? The text will be in Khmer (UTF-8). I've already tried imagettftext (php) but it doesn't seem to be compatible with Khmer Unicode fonts (see here).
The word separation character is not a normal space as in English, but a zero-width space (U+0200B).
Sample Text:
កាល​ដើម​ដំបូង​ឡើយ ព្រះ​បាន​បង្កើត​ផ្ទៃ​មេឃ និង​ផែនដី។
Any help you can give would be greatly appreciated! Thank you!
Use Gtk3::WebKit to capture rendered HTML to any libcairo output target.
As of 2011, this is the most modern and flexible solution.
Sample rendering to PNG of the whole Khmer phrase
Another option would be to prerender the texts with LaTeX.
For simple I would use Perl::GD. I have used it in the past. Take a look at this.

How do I work with a C++ program containing non-Latin characters?

I have a C++ program that was written by a Russian-speaking developer and so it contains Cyrillic characters. When I open the sources they are displayed as garbage. How do I solve this in windows ?
The actual problem is your IDE/editor doesn't display Cyrillic characters correctly. You solve this by changing the IDE/editor settings to use a font that contains Cyrillic characters - for example, Courier New if you're on Windows.
Well, assuming they've actually used ISO C and not some weird Russian variant, the language constructs and standard library calls will be in English (or its strange cousin, American).
The only thing you'll really need to convert are the strings (such as for user output or logging), code comments and variable names.
And even the comments and variable names may not have to change. They may make the code harder to understand to a non-Russian reader however.
If the code contains characters that your current editor doesn't understand, well, you need to get yourself an editor that does. Or get your Russian friends to turn it into English for you.
Don't think that there is another C++ programming language in russia. So you just need to replace the strings to the other language, i.e. English. Care must be taken when processing input since here you can find handling of single characters.
A better approach would be to prepare a localization. You can read all strings from a ressource or file. In that case you can select the resource that matches you target language.
If you mean that the strings of the program are written in Russian and you want to add English texts, you need to first internationalize (i18n) your program, using instead of static strings a library like Gettext; then you need to add support for the English locale.
If you mean that the variables and the comments are in Russian and you want them in English, well.. find a translator ;)
Find a translator and give him the code.