Read three more shapes of code as literal blocks - #55
Merged
Conversation
L01 reports an entry whose translation is identical to its source, and 5 of
its 9 findings were entries there was nothing to translate in. The block rule
called them prose, so each one went to a model, came back unchanged because
unchanged was correct, and was then refused for being unchanged.
Three shapes were missing. A block opener quoted without its body has no
second line to indent and no call to recognise, which is
`def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):`. A line with a comment on
the end is code plus English and the English hid the code, which is
`parrot(1000) # 1 positional argument`. And a call whose arguments are
quoted strings has spaces inside the quotes, and the spacing rule was
counting those as prose, which is `parrot('a million', 'bereft of life',
'jump')`.
The keyword list stops where English starts. `if`, `for`, `while`, `with` and
`else` open blocks and are also ordinary words, and a colon is how the
documentation introduces a list. Adding them reaches 4 more entries and 2
sentences, `while a positional argument could be created like::` and `if it
is 3, implements::`, so they are out and there are tests holding them out.
The comment rule wants two spaces before the hash, which is how PEP 8 says to
write one and how every one of these in the corpus is written.
67 entries move from prose to literal_block, 0.08 per cent of the corpus. 67
is small enough to read one at a time and all 67 were read: no prose among
them. One batch fewer on a full run.
5 of the 67 are entries somebody had already translated, and those 5 are
exactly what L01 was reporting. They leave the memory, because human says who
typed a string and not that the string wanted typing.
This was referenced Aug 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50.
L01reports an entry whose translation is identical to its source. 5 of its 9 findings were entries there was nothing to translate in, so being identical was the correct answer and the check was reporting a classifier bug rather than a translation bug.The rule was missing three shapes.
A block opener quoted without its body. There is no second line to be indented and no call to recognise, so every rule read it as a sentence ending in a colon.
A line with a comment on the end. The code is there, and the English on the end of it stopped any rule from seeing it.
A call whose arguments are quoted strings. What separates a call from a sentence here is spacing, code putting a space after a comma and nowhere else, and the spaces inside the quotes were being counted.
The keyword list
It stops where English starts.
if,for,while,withandelseopen blocks and are also ordinary words, and a colon is how the documentation introduces a list. The wide list was measured before it was dropped: it reaches 4 more entries and 2 sentences,while a positional argument could be created like::andif it is 3, implements::. Those two are in the tests as negatives. The comment rule wants two spaces before the hash, which is how PEP 8 says to write one and how every one of these in the corpus is written; one space reaches 2 more entries and reads a hash anywhere in a sentence as a comment.Measured
67 entries move, 0.08 per cent of the corpus. That is small enough to read one at a time, and all 67 were read before this was written: no prose among them.
The 5 human segments that go are exactly the 5
L01findings. They were translated by being copied, because copying was correct.humansays who typed a string, not that the string wanted typing.Checks
make checkgreen, 1,399 tests, 97.45 per cent coverage,classify.pyat 100 per cent.H03clean.