Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"empty" textelements may have bogus offsets #53

Closed
kosloot opened this issue Mar 20, 2023 · 1 comment
Closed

"empty" textelements may have bogus offsets #53

kosloot opened this issue Mar 20, 2023 · 1 comment

Comments

@kosloot
Copy link
Contributor

kosloot commented Mar 20, 2023

A bit related to #52:
and proycon/folia#107

the library accepts bogus offset values for empty elements.
Input:

<?xml version="1.0" encoding="UTF-8"?>
<FoLiA xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://ilk.uvt.nl/folia" xml:id="bugxx" generator="libfolia-v1.11" version="2.5">
  <metadata type="native">
    <annotations>
      <text-annotation set="https://raw.githubusercontent.com/proycon/folia/master/setdefinitions/text.foliaset.ttl"/>
      <division-annotation/>
      <paragraph-annotation/>
      <sentence-annotation/>
      <token-annotation/>
      <hyphenation-annotation/>
      <string-annotation/>
    </annotations>
  </metadata>
  <text xml:id="bug">
    <div xml:id="bug.div">
      <p xml:id="bug.div.p">
        <s xml:id="bug.div.p.s.1">
	  <t>appel<t-hbr>-</t-hbr>taart</t>
          <str xml:id="bug.div.p.s.1.str.1">
            <t offset="0">appel</t>
	  </str>
          <str xml:id="bug.div.p.s.1.str.2">
            <t offset="766666665"><t-hbr>-</t-hbr></t>
	  </str>
          <str xml:id="bug.div.p.s.1.str.3">
            <t offset="5">taart</t>
	  </str>
        </s>
      </p>
    </div>
  </text>
</FoLiA>

The offset of str.2 is way off. But will pass.
The value should be 5, or at least within the range [0-9] (the valid characters in the text of the sentence)

@kosloot
Copy link
Contributor Author

kosloot commented Mar 21, 2023

Experimental code for libfolia is in GitHub now. Seems to work

@kosloot kosloot added Testing and removed bug labels Mar 21, 2023
@kosloot kosloot closed this as completed Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant