sillsdev / SpeechAnalyzer

SIL Speech Analyzer is a Windows program for acoustic analysis of speech sounds.
https://software.sil.org/speech-analyzer/
7 stars 3 forks source link

bug: Remove optional spans in <text> elements during SA Lift export #72

Closed darcywong00 closed 2 years ago

darcywong00 commented 2 years ago

Report from Jennifer

Okay, I just noticed this morning that when using the LIFT feature, the English gloss has a return and 10 spaces in front of the English gloss in FLEx.

The first entry "sky", I deleted the white space from. The other entries show the white space, which was more evident with the students' data because there was text wrapping involved. It basically looks like a hanging indent at that point. 00ctrdVPkMdtBEVi


Looking at the Lift 13 file that SA exports:

    <sense id="45ccc726-4903-4b78-b47c-5fc06557f1d5" order="0">
      <gloss lang="en">
        <text>
          <span>say-3sing.Sequential</span>
        </text>
      </gloss>
      <gloss lang="es">
        <text>
          <span>tacos</span>
        </text>
      </gloss>
    </sense>

Currently, SA lift export is using optional <span> elements for each <text> element, and it appears FLEx is rendering those extra lines/spaces.

Contrasting with WeSay Lift file or when I remove the whitespace in FLEx and do a Lift export from Flex, the results are <text> elements without <span>s

<gloss lang="en"><text>say-3sing.Remote</text></gloss>

Workaround

In FLEx, use the following for Bulk Edit Operation setup to remove the extra whitespace ("Use regular expressions" checked)

Replace
Find what: ^\s+(.+)\s+
Replace with: $1
darcywong00 commented 2 years ago

Even though SA is using <span> in every <text> element, I initially thought we'd just limit this change to <gloss>. Jennifer updates

The "label" field and "reference" field also have extra spaces as well as the "gloss" field.