Random header image... Refresh for more!

Give Me A Line Break

The Congress shall have no Vote, unless they be equally divided.

The way I’m parsing the text, it doesn’t like line breaks.

The way I’m parsing the text, I didn’t pay any attention to new lines, other than trimming them out.  The problem with that is that is that the initial stage can only be the first word in the text, and the termination stage can only be the last word in the text.  While the termination stage doesn’t really matter, since it’s easy enough to put a limit on the number of words, the initial stage is critical.  If you only have one initial stage, then everything it says will start with the same exact words.

The way I’m parsing the text, you can see how that would get annoying.

The way I’m parsing the text, it had to change.

So, I tried replacing all line breaks with special sentinel strings that would cause them to be treated as initiators and terminators.

That had an odd side effect.

Half the time I got no text.  Turns out there were cases that there were multiple line breaks in a row, so I was getting an initiator state followed immediately by a terminator.  Not terribly useful.

Looks like I’ll have to work on that a bit…

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment