Repository navigation
Measure readings, open roles, and contested pronouns - #729
Merged
Merged
Conversation
The sentence parser says whether a sentence has a canonical parse. The November assessment's central finding is that many sentences have several, because Phi marks the edges of embedded clauses and leaves the commoner phrase edges unmarked. This adds the instrument to measure that before anything is decided about marking them. `phi_readings.py` counts, for each clause, the ways the words before the verb divide into subject, adjuncts, object, and manner, and the places each adverbial or relative clause could end. `audit_phrase_readings.py` runs it over the lexicon's examples and the active Markdown, or shows one sentence's divisions. The count has no verb valency and no meanings. It is an upper bound on structural choice, and the validator notes say what it leaves out. No baseline is committed and no language rule changes. D132 records the first measurement.
The reading count cannot see the two kinds of misreading verified in certified text: a lone bare phrase taken as object where subject was meant, and a `shia` given to the wrong referent. The maintainer asked for both to be measured and for the figures to be tracked. `phi_roles.py` counts clauses whose one bare phrase may be subject or object, and uses of `shia` while two or more third persons are live. The lexicon has no valency field, so a verb counts as taking an object when the corpus shows it in the passive, with two separate bare phrases, or in a command over a noun phrase. `documents/validation/phrase_readings_baseline.txt` now records all three measures with one row per file. CI checks it, and the working rules name the command that regenerates it. D133 records the first measurement.
This was referenced Nov 24, 2026
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.
Summary
The sentence parser answers one question: does this sentence have a canonical parse? The November assessment's central finding (section 4.3) is that many sentences have several, because Phi marks where an embedded statement, question, or quotation ends and leaves the more frequent phrase edges unmarked. Its first recommended step was to measure that before deciding anything.
This pull request adds the instruments and a tracked ledger. It changes no language rule and no text.
It measures three things: how many ways a sentence divides into phrases, how many clauses leave a role open, and how often
shiahas more than one third person to choose from.1. Readings
For each clause,
scripts/phi_readings.pytakes the words before the Slot 1 stack (or before the verb when there is no stack) and enumerates every division that canon's order allows: subject, adjuncts, object or complement, then manner. It adds every place an adverbial or relative clause could end. Readings multiply across the clauses of a sentence, and each sentence inside a quotation counts as a sentence of its own.phao lopia shelu theo.has three readings: the parent reads the child's book, the parent's child reads the book, and one phrase with nobody named as reader.mia shia wiru ma nila.has one, because a pronoun begins its phrase.The conservative count lets only a noun, pronoun, or name end a phrase freely. The full count also lets an event noun or a quality noun head a phrase with its own modifiers, so
mia nohero to helui.gains "my belief changed" beside "I changed the belief".In the texts, one sentence in five has a noun or a name directly beside a noun with the phrase edge open between them. About one adverbial clause in five and one relative clause in five has more than one grammatical end. Treating
ha,ra, andloas words that always open a new phrase (the--openerswhat-if) lowers the translations' conservative figure from 42% to 35%.2. Open roles
The reading count cannot see a clause like
lo phirae tupiwa so ma nila, which has one phrase and one division. The phrase is still either the subject or the object ofnila, and a source-blind reader of the certified Velveteen Rabbit took it as the object where the translator meant the subject.scripts/phi_roles.pycounts these. An open role is a clause with one bare phrase and a verb that takes an object elsewhere. A relative clause has the same opening when one phrase is left inside it. A passive, a command, or a second bare phrase settles the role.The lexicon records no valency, so the corpus supplies it. A verb counts as taking an object when it appears at least once in the passive, with two bare phrases that cannot be read as one, or in a command over a noun phrase, in a clause with a single structural reading. That gives 154 verbs.
miaorthiaThe verbs found most often with an open role are
haolu,theo,nila, andshelomu.3. Third persons
Phi has one third-person pronoun. The tracker follows which third persons are live (the noun or name heading a clause-initial bare phrase, for three further sentences) and counts each
shiathat has two or more to choose from. It also counts clauses with two separateshia, and unsaid subjects.shiashiaTwenty-five of the 38 two-
shiaclauses are in The Velveteen Rabbit. One of them is the second misreading the assessment verified,shia roa shia to pa rato.What the figures are not
mia nosa thole.counts "my now practices" beside "I practice now", and a first-personmia nila.counts as an open role that no reader stumbles on. None of the figures is a rate of misunderstanding.The ledger
documents/validation/phrase_readings_baseline.txtholds one row per file with all three measures, and every dictionary example under onevocabulary/row. CI regenerates it and fails on a difference.CLAUDE.mdgains the regeneration command beside the two existing ledgers, with a note that these numbers are measurements and a higher one blocks nothing.A row usually changes only when its file does. The open-role columns can also move when another file adds the first witness that a verb takes an object.
Files
scripts/phi_readings.py: the reading counter, a subclass of the parser that reuses its legality checks.scripts/phi_roles.py: object-taking verbs from the corpus, open roles, and the third-person tracker.scripts/audit_phrase_readings.py: the report, a single-sentence view (--sentence), the what-if (--openers), and the ledger (--output,--check).scripts/test_phi_readings.pyandscripts/test_phi_roles.py: twenty-five tests, run in CI.documents/validation/phrase_readings_baseline.txt: the ledger.documents/validation/sentence_validator.md,scripts/README.md,documents/README.md,project/handoff/repository_workflow.md,CLAUDE.md: the models, their limits, and the commands.project/development_log.md: D132 and D133.Judgement calls to check
mia lohau naiis applied: beforenaiorkelu, a clause-initial pronoun is not counted as the owner of the complement alone.ka, three bare phrases are allowed (causer, causee, object). Otherwise the limit is two.CLAUDE.mdis edited to add the regeneration rule.Voice and Humanizer pass
The pass covered the commit messages and this description. The validator notes and log entries are internal records. One change came out of the read-through: the summary had a sentence narrating which measure was added when, which described the history of the pull request instead of its content. It now says what the three measures are.
Checks
python3 scripts/test_phi_readings.pyandpython3 scripts/test_phi_roles.py: 25 tests, OKpython3 scripts/test_sentence_validator.py: OKpython3 scripts/validate_examples.py: 0 errors, 0 warningspython3 scripts/validate_sentences.py: 3374 examples, 0 errorspython3 scripts/audit_phrase_readings.py --checkandpython3 scripts/audit_sentence_order.py --check: currentpython3 scripts/build_site.pybuilds