Page 1 of 1

Inconsistent one-liner RLE parsing (a feature?)

PostPosted: January 14th, 2017, 2:03 am
by Scorbie
With Golly 2.9b1 on 64bit Linux (Linux Mint), the one-line RLE of the hive is parsed as a string rather as an RLE.
bo$obo$obo$bo
(Edit: the tub, too.)
bo$obo$bo

Other patterns does not exhibit this behavior; Compare:
2o$2o

2b2o$3bo$3o$o

b2o$o2bo$bobo$2bo


Note: These RLEs have their !s at the end removed. I haven't tested it thoroughly, but all of them seem to work with the ! appended.

Re: Inconsistent one-liner RLE parsing (a feature?)

PostPosted: January 14th, 2017, 11:10 am
by dvgrn
Scorbie wrote:With Golly 2.9b1 on 64bit Linux (Linux Mint), the one-line RLE of the hive is parsed as a string rather as an RLE.
bo$obo$obo$bo
(Edit: the tub, too.)
bo$obo$bo

Other patterns does not exhibit this behavior; Compare:
2o$2o

2b2o$3bo$3o$o

b2o$o2bo$bobo$2bo


Note: These RLEs have their !s at the end removed. I haven't tested it thoroughly, but all of them seem to work with the ! appended.

Little chunks of text are sometimes hard to guess, if there are no reasonably definitive markers present, like an exclamation point. Without looking at the parsing code, I'd guess that if there are no 0..9 digit characters in the text chunk, then the parser guesses that the text is an ASCII pattern.

It's a good guess in most cases. If you want it to guess better in other cases, add a ! ...

Re: Inconsistent one-liner RLE parsing (a feature?)

PostPosted: January 14th, 2017, 2:35 pm
by rowett
dvgrn wrote:Little chunks of text are sometimes hard to guess, if there are no reasonably definitive markers present, like an exclamation point. Without looking at the parsing code, I'd guess that if there are no 0..9 digit characters in the text chunk, then the parser guesses that the text is an ASCII pattern.

It's a good guess in most cases. If you want it to guess better in other cases, add a ! ...


The code says:
// Everything seems parseable; assume this is RLE if either we saw some
// digits, or the pattern ends with a '!', both of which are unlikely to
// occur in plain text patterns:

Re: Inconsistent one-liner RLE parsing (a feature?)

PostPosted: January 22nd, 2017, 10:28 am
by Scorbie
Oh, thank you! I wasn't aware of this...
N.B. that wasn't from me, was from sample input from CatForce.
Good thing to know, especially dealing with external RLE source.

Another similar hack: To feed a single-line RLE to Golly, you just have to prepend a newline. I'm pretty sure golly doesn't mind empty first lines. (Starting the line with a hash to make a comment also works.)

Re: Inconsistent one-liner RLE parsing (a feature?)

PostPosted: January 22nd, 2017, 7:02 pm
by BlinkerSpawn
Digits and trailing exclamation points aren't too uncommon in plaintext.
Multiple dollar signs in a single line would be a telltale sign of RLE though.

Re: Inconsistent one-liner RLE parsing (a feature?)

PostPosted: January 24th, 2017, 4:33 am
by calcyman
BlinkerSpawn wrote:Digits and trailing exclamation points aren't too uncommon in plaintext.
Multiple dollar signs in a single line would be a telltale sign of RLE though.


Conversely, plaintext patterns tend to only contain .*o$ and newlines. Multiple dollars can occur in a single line, since Dean Hickerson used them to abbreviate ten spaces.