Talk:Execute a Markov algorithm: Difference between revisions

Content added Content deleted
Line 210: Line 210:
The rule for <rule> seems to indicate NO <whitespace> in a pattern but that isn't consistent with the examples. If a pattern can contain <whitespace>, then "->.* -> money" conflicts with "the shop -> my brother" because "<pattern> <whitespace> -> <whitespace>" is going to break on one or the other when trying to find <pattern> ("->.*"/"the" or ""/"the shop"???).
The rule for <rule> seems to indicate NO <whitespace> in a pattern but that isn't consistent with the examples. If a pattern can contain <whitespace>, then "->.* -> money" conflicts with "the shop -> my brother" because "<pattern> <whitespace> -> <whitespace>" is going to break on one or the other when trying to find <pattern> ("->.*"/"the" or ""/"the shop"???).
: <pattern> doesn't seem to be defined. It can definitely contain whitespace. The regex engine will notice that the whitespace after "the" isn't followed by an arrow and will include it in the capture, and continue to look for a whitespace followed by an arrow further down the line. [[User:Fwend|Fwend]] ([[User talk:Fwend|talk]]) 22:34, 1 June 2014 (UTC)
: <pattern> doesn't seem to be defined. It can definitely contain whitespace. The regex engine will notice that the whitespace after "the" isn't followed by an arrow and will include it in the capture, and continue to look for a whitespace followed by an arrow further down the line. [[User:Fwend|Fwend]] ([[User talk:Fwend|talk]]) 22:34, 1 June 2014 (UTC)
::You are correct, <pattern> isn't defined, and it took me several tries to figure out a definition due to the ambiguities. Which was annoying. Your RE engine may work that way, mine doesn't.
:::<pattern> ::= <any char>+
:::<replacement> ::= <pattern>
:::<rtoken> ::= <1whitespace> -> <1whitespace>
:::<rule> ::= <pattern> <rtoken> [.] <replacement>
::This also clarifies that "foo ->" is an invalid <rule> but introduces other ambiguities.