[libvoikko] error handling in the grammar checker

Francis Tyers ftyers at prompsit.com
Tue Oct 1 19:24:17 EEST 2013


Hello again!

I'd like to get ideas on how people think it would be best to deal with
abstracting the grammar/error.hpp grammar/error.cpp code. At the moment
there are some hardcoded messages for Finnish. For North Sámi, we have
(so far) around 140 error tags: http://pastebin.com/YKGbCxzx

Rather than just including these in the C++ code, I think it might be
better to abstract out into a file which contains the error codes and
messages. This could be XML, or tab separated or however. 

One question is, which information would we like to have in the file ? 

To deal with the Finnish we'd need at least something like:

<code>13</code>
<descriptions>
  <description xml::lang="fin"/>
  <description xml::lang="eng"/>
<description>

We could also think about having long/short descriptions, and also of
linking in the suggestions somehow. 

Any thoughts on a nice file format for this ? 

Fran




More information about the Libvoikko mailing list