Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-4119

New AutoQA internal tag category "structural sub-segment errors" and automatic fixing

Details

    • Improvement
    • Resolution: Unresolved
    • None
    • None
    • Auto-QA
    • High
    • IMPROVEMENT: detect structural tag-problems between sub-segments of a trans-unit, show them as a new AutoQA error category and fix them automatically on export

    Description

      OKAPI will wrap opening/closing tags in sub-segments (segments of a segmented trans-unit) in <it> tags instead of <bpt>/<ept>
       

      <trans-unit>
      	<source>
      		...
      		<bpt id="27">&lt;run27&gt;</bpt> ... <ept id="27">&lt;/run27&gt;</ept>
      		...
      		<bpt id="26">&lt;run26&gt;</bpt> .... <ept id="26">&lt;/run26&gt;</ept>
      		...
      	</source>
      	<seg-source>
      		<mrk>
      			...
      			<it id="27" pos="open">&lt;run27&gt;</it>
      			...		
      		</mrk>
      		<mrk>
      			...
      			<it id="27" pos="close">&lt;/run27&gt;</it>
      			...
      			<bpt id="26">&lt;run26&gt;</bpt> .... <ept id="26">&lt;/run26&gt;</ept>
      			...
      		
      		</mrk>
      	</seg-source>
      	<target>
      		<mrk>	
      			...	
      			<it id="27" pos="open">&lt;run27&gt;</it>
      			...
      		</mrk>
      		<mrk>
      			...
      			<bpt id="26">&lt;run26&gt;</bpt>
      				...
      				<it id="27" pos="close">&lt;/run27&gt;</it>
      				...				
      			<ept id="26">&lt;/run26&gt;</ept>		
      			...
      		
      		</mrk>
      	</target>
      </trans-unit>
       

      When in the pretranslation or the translation in t5 the order is changed, this may creates invalid markup causing OKAPI errors on export.

      Solution

      • detect such tags in the import and add an attribute to the internal tag "t5nextSubSegIdx" or "t5prevSugSegIdx" and a marker-class "t5subsegtag" that marks them as such "segment overlapping tags" and define the order they had in the original segment (in case we have more than one).
      • In the auto-qa, add new category SUBSEGMENT_TAG_STRUCTURE_FAULTY = 'subseg_tag_structure_faulty'
      • in the automatic tag-repair, add a second step to repair such problems by moving those tags to the outer borders of a segment

      example-structure:

      <segment1>
          ...
          <internal-tag1 class="... t5subseg t5subopen" t5subSegIdx="2" />
          ...
          <internal-tag2 class="... t5subseg t5subopen" t5subSegIdx="1" />
          ...
      </segment1>
      <segment2>
          ...
          <internal-tag1 class="... t5subseg t5subclose" t5subSegIdx="1" />
          ...
          <internal-tag2 class="... t5subseg t5subclose" t5subSegIdx="2" />
          ...
      </segment2>
      

      Attachments

        Activity

          People

            axelbecher Axel Becher
            axelbecher Axel Becher
            Axel Becher
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: