Skip to content

Question: FoLiA-abby conversion to t-hspace  #62

Closed

Description

@pirolen

Another whitespace question: in the attached file, several of the 'simple' whitespaces between tokens are represented as a t-hspace, instead of preserving them as space character.
One such example is at the string 'L. Caecil...'.

Due to this, the original string segmentation gets difficult to reconstruct in some use cases, e.g. when the data structure is assumed to have a specific semantics based on the order/amount of style elements.

<line baseline="721" l="1260" t="685" r="2059" b="729"><formatting lang="GermanStandard" ff="Times New Roman" fs="11.">
<charParams l="1260" t="686" r="1289" b="720" wordFirst="1" wordLeftMost="1" wordFromDictionary="0" wordNormal="1" wordNumeric="0" wordIdentifier="0" charConfidence="39" serifProbability="100" wordPenalty="0" meanStrokeWidth="58">L</charParams>
<charParams l="1295" t="714" r="1300" b="720" wordFromDictionary="0" wordNormal="1" wordNumeric="0" wordIdentifier="0" charConfidence="83" serifProbability="255" wordPenalty="0" meanStrokeWidth="58">.</charParams>
<charParams l="1301" t="685" r="1314" b="721"> </charParams></formatting><formatting lang="Latin" ff="Times New Roman" fs="11.">
<charParams l="1315" t="685" r="1344" b="721" wordFirst="1" wordLeftMost="1" wordFromDictionary="1" wordNormal="1" wordNumeric="0" wordIdentifier="0" charConfidence="100" serifProbability="57" wordPenalty="0" meanStrokeWidth="42">C</charParams>
<charParams l="1349" t="696" r="1368" b="721" wordFromDictionary="1" wordNormal="1" wordNumeric="0" wordIdentifier="0" charConfidence="100" serifProbability="74" wordPenalty="0" meanStrokeWidth="42">a</charParams>
<charParams l="1371" t="697" r="1390" b="721" wordFromDictionary="1" wordNormal="1" wordNumeric="0" wordIdentifier="0" charConfidence="100" serifProbability="90" wordPenalty="0" meanStrokeWidth="42">e</charParams>

-->
<t-style><t-lang class="GermanStandard"/><feat class="Times New Roman" subset="font_family"/><feat class="11." subset="font_size"/>L.<t-hspace class="space"/></t-style><t-style><t-lang class="Latin"/><feat class="Times New Roman" subset="font_family"/><feat class="11." subset="font_size"/>Caecilius Metellus (Diadematus)<t-hspace class="space"/>

I wonder if the reason could be that this Abbyy file is formatted somewhat differently, since there are cells and rows in it (which the converter does not represent, if I see it correctly) and this causes the space dimensions to look different to the converter, or could there be another reason. Thanks!
b1_2_reg_pers_pp413_418.png.xml.txt

Activity

  1. kosloot commented on Aug 5, 2021

    @kosloot
    Contributor

    Well, the explanation is quite simple:
    leaving out some details and reformatted, Abby produces this:

    <line>
      <formatting lang="GermanStandard" ff="Times New Roman" fs="11.">
        <charParams>L</charParams>
        <charParams>.</charParams>
        <charParams> </charParams>
      </formatting>
      <formatting lang="Latin" ff="Times New Roman" fs="11.">
        <charParams>C</charParams>
        <charParams>a</charParams>
        <charParams>e</charParams>
    ...

    So there is a change in formatting between "L. " and "Cae". In fact a change in Language.
    For the FoLiA-abby converter this signals a token boundary. Hence 2 tokens.
    Next: FoLiA doesn't allow for a trailing space, so this has to be replaced by an <t-hspace>

    This is not really solvable, I am afraid. A change in Language is a strong signal for a token boundary, and we should not ignore it.

  2. pirolen commented on Aug 5, 2021

    @pirolen
    Author

    Sure, I see, thanks!

  3. pirolen commented on Aug 10, 2021

    @pirolen
    Author

    Just quick question: any chance that the rows and cells in the Abbyy file would be kept by the converter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions