Skip to content

Bridge bug: MIF filter does not expose <Char Tab> as inline text #18

Description

@asgeirf

Surfaced by the spec contract audit (spec/mif).

Symptom

The Okapi MIFFilter does not expose the inline <Char Tab> statement as a literal tab character (\t, U+0009) in the extracted text. Native core/formats/mif/ decodes <Char Tab> to a literal \t inside the surrounding paragraph (matching the Adobe MIF Reference contract that <Char Tab> represents an inline tab character). The bridge-extracted block text omits the tab — the two <String> runs flanking the <Char Tab> come through joined without any separator, so a downstream has_block_with_text: ["\t"] assertion fails on the bridge side.

The same divergence likely applies to the other inline <Char …> variants the spec covers under special_char_statements: HardSpace (U+00A0), SoftHyphen (U+00AD), EnSpace (U+2002), EmSpace (U+2003), ThinSpace (U+2009). The current example only exercises Tab — additional examples can be added once this is resolved upstream.

Reproduction

core/formats/mif/spec.yaml feature special_char_statements::tab_between_strings:

input MIF:
  <Para
   <PgfTag `Body'>
   <ParaLine
    <String `Before tab'>
    <Char Tab>
    <String `after tab.'>
   >
  >

native:  block contains "Before tab", "\t", "after tab."  (correct per MIF Reference)
bridge:  block contains "Before tab", "after tab."        (tab character missing)

Spec tags

The example is tagged expected_fail: in core/formats/mif/spec.yaml so the parity gate downgrades it to a warning until the bridge is fixed (or until we agree the bridge's placeholder representation is intentional and adjust the spec assertion accordingly). Once the bridge fix lands, drop the expected_fail: block.

Repro test

KAPI_PARITY_SANDBOX=$PWD/.parity \
  go test -tags parity -run TestParityMifSpec -count=1 -v ./parity/...

(from cli/, on branch spec/mif)

Affected upstream code

okf_mif Java filter — net.sf.okapi.filters.mif.MIFFilter (Okapi 1.47.0 / 1.48.0). Likely in the <Char …> statement handler that converts the structural character into a TextFragment / inline code — the inline placeholder is not being re-expanded to its Unicode equivalent in the source string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions