Inconsistent one-liner RLE parsing (a feature?)

Has something gone haywire? Let us know about it!
Post Reply
User avatar
Scorbie
Posts: 1388
Joined: December 7th, 2013, 1:05 am

Inconsistent one-liner RLE parsing (a feature?)

Post by Scorbie » January 14th, 2017, 2:03 am

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.

Code: Select all

bo$obo$obo$bo
(Edit: the tub, too.)

Code: Select all

bo$obo$bo
Other patterns does not exhibit this behavior; Compare:

Code: Select all

2o$2o

Code: Select all

2b2o$3bo$3o$o

Code: Select all

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.
Best wishes to you, Scorbie

User avatar
dvgrn
Moderator
Posts: 5874
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

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

Post by dvgrn » January 14th, 2017, 11:10 am

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.

Code: Select all

bo$obo$obo$bo
(Edit: the tub, too.)

Code: Select all

bo$obo$bo
Other patterns does not exhibit this behavior; Compare:

Code: Select all

2o$2o

Code: Select all

2b2o$3bo$3o$o

Code: Select all

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 ! ...

User avatar
rowett
Moderator
Posts: 1730
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

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

Post by rowett » January 14th, 2017, 2:35 pm

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:

Code: Select all

// 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:

User avatar
Scorbie
Posts: 1388
Joined: December 7th, 2013, 1:05 am

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

Post by Scorbie » January 22nd, 2017, 10:28 am

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.)
Best wishes to you, Scorbie

User avatar
BlinkerSpawn
Posts: 1905
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

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

Post by BlinkerSpawn » January 22nd, 2017, 7:02 pm

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.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Image

User avatar
calcyman
Posts: 2095
Joined: June 1st, 2009, 4:32 pm

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

Post by calcyman » January 24th, 2017, 4:33 am

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.
What do you do with ill crystallographers? Take them to the mono-clinic!

Post Reply