Repository navigation
Initialized HunspellSpellchecker object with an iconvstr function - #6
Conversation
…mented encoding enhanced checkSpelling method.
There was a problem hiding this comment.
Yes, we should typedef the boost::function. I'd say right above the declaration of the createHunspell function in SpellChecker.hpp. Also, in boost::function declarations you can exclude the parameter names (e.g from, to, allowSubstitution, etc. aren't necessary).
Another minor nit: I know I referred to the boost::function construct as a "function pointer" the other day -- this is conceptually true but since it's not actually a C pointer we shouldn't use the p prefix (as in "pIconvStr"). I'd use something like iconvstrFunc instead.
There was a problem hiding this comment.
Ah, yes dropping the p makes total sense. BTW What's the significance of the _ while we're on the subject of pointer names?
There was a problem hiding this comment.
The trailing _ indicates a C++ member variable. The only other variable naming convention besides that we have is using s_ as a prefix for statics.
|
Added another commit. |
There was a problem hiding this comment.
Typename here should be capitalized
|
Another commit! |
There was a problem hiding this comment.
maybe we should call this copyAndFreeHunspellVector?
Initialized Hunspell Spellchecker object with an iconvstr function
A couple of questions on this one:
Should the boost::function<core::Error(const std::string& value, const std::string& from, const std::string& to, bool allowSubstitution, std::string* pResult)> type be typedef'd? And if so, where should it go?
Is there overhead in opening and closing the iconv files every time iconvstr is called? The only time they really need to be opened is when the HunspellSpellchecker object is created. How about caching the dictionary encoding?