No subject


Sun May 13 13:41:23 UTC 2007


Although there is no imposed limit on the length of a string, string
  literals must be less than 256 characters in length.  It is possible
  to construct strings longer than this by string concatenation, e.g.,

             "This is the first part of a long string"
              + " and this is the second part"

Since DictionariesCommon generates S-Lang code, this limitation applies.

Broadly, there are three ways to fix this:
- catch the "String too long" error in a catch block. Tough luck for
Bulgarian speakers.
- Split the string up, as suggested in the manual. An example of how to do
this can be found in the autotext.sl mode.
- Instead of generating S-Lang code, generate some data file and provide a
S-Lang script to parse those data. One way to do this would be to
generate XML and parse that with the expat module. Another way would be
to store the data in a SQLite table, and in fact the next version of
autotext.sl may do that. Or maybe the readascii.sl library provided with
slsh can be used for this. Note that if the string isn't sourced by
S-Lang, you don't get the "\x{__}" substitution.

I think I'd go for the second option.



More information about the Dict-common-dev mailing list