Skip to content

Commit fcc2347

Browse files
alex-rawlings-yyccursoragent
andcommitted
Reintroduced 'Excluded' flag in interlinear XML parsing and update documentation
- Reintroduced an optional 'Excluded' boolean flag to the ClusterData structure, allowing for location-specific exclusion of phrases in the interlinear display. - Updated README to document the 'Excluded' attribute and its behavior. - Enhanced unit tests to validate parsing of the 'Excluded' flag in XML input, ensuring correct handling of both true and false values. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2d38026 commit fcc2347

5 files changed

Lines changed: 95 additions & 46 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ The extension reads interlinear data from XML files (e.g. `Interlinear_<lang>_<b
150150
- **Attributes:**
151151
- `Id` (required): Lexeme id (e.g. from a Lexicon).
152152
- `GlossId` (optional): Sense/gloss id; omitted or empty is treated as empty string.
153+
- **`Excluded`** (optional): Boolean flag indicating this instance of a phrase should be excluded from the interlinear display at this specific location. This is a very niche property that is included because it's possible to be present in the XML, even though it's rarely used. When `true`, the phrase is not displayed at this location but remains available elsewhere. The exclusion is location-specific (applies to this instance at this text range, not globally). Omitted or `false` means the phrase is included.
153154

154155
- **Punctuation**
155156
- **Children:**
@@ -163,7 +164,7 @@ The parser produces objects conforming to the types in `src/types/interlinearize
163164

164165
- **InterlinearData:** `ScrTextName`, `GlossLanguage`, `BookId`, `Verses` (record of verse key → **VerseData**).
165166
- **VerseData:** `Hash`, `Clusters` (array of **ClusterData**), `Punctuations` (array of **PunctuationData**).
166-
- **ClusterData:** `TextRange` (`Index`, `Length`), `Lexemes` (array of `{ LexemeId, SenseId }`), `LexemesId` (slash-joined lexeme IDs), `Id` (cluster id: `LexemesId/Index-Length` or `Index-Length` when there are no lexemes).
167+
- **ClusterData:** `TextRange` (`Index`, `Length`), `Lexemes` (array of `{ LexemeId, SenseId }`), `LexemesId` (slash-joined lexeme IDs), `Id` (cluster id: `LexemesId/Index-Length` or `Index-Length` when there are no lexemes), `Excluded` (boolean flag for location-specific exclusion).
167168
- **PunctuationData:** `TextRange`, `BeforeText`, `AfterText`.
168169

169170
### Example (minimal valid document)

package-lock.json

Lines changed: 21 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)