GithubHelp home page GithubHelp logo

Comments (7)

mr-martian avatar mr-martian commented on May 30, 2024

The -p / --postgen option should do most of this.

Currently if lsx-proc is not in postgen mode, there's no handling for /, which is probably a mistake, though I'm not entirely sure what the correct behavior would be.

from apertium-separable.

unhammer avatar unhammer commented on May 30, 2024
$ cat input.txt
^A\/B-testing/A\/B-testing<pr><aa><@adv>$
^lov/lov<n><m><sg><ind><aa><@←p-utfyll>$
^om/om<pr><aa><@adv>$
^frittståande/*frittståande$
^skolar/*skolar$

$ lsx-proc rules.bin < input.txt
^A\/B-testing\/A\/B-testing<pr><aa><@adv>$
^lov om frittståande skolar\/lov om frittståande skolar<np>$

$ lsx-proc -p rules.bin < input.txt
^A/B-testing<pr><aa><@adv>$
^lov om frittståande skolar/lov om frittståande skolar<np>$

so close! (Is that a bug for regular postgen usage as well?)

from apertium-separable.

mr-martian avatar mr-martian commented on May 30, 2024

That does look like a bug in the escaping. I've never tried to pass words with slashes through regular postgen so I have no idea whether it applies there as well.

If you get to it before I do, the problem is probably in one of the if (postgen) blocks (maybe split_escaped?) or maybe in the filterFinals step, if something messed with the list of escaped characters.

from apertium-separable.

unhammer avatar unhammer commented on May 30, 2024

I'm not so sure it can be solved completely correctly without a difference between reading-separator and literal / in the format. If we do

    <e>
      <i>x/y<s n="pr"/><d/></i>
      <p><l></l><r>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</r></p>
    </e>

then in typical dix files that would match a literal (escaped in input) slash, though it will also match an unescaped one:

$ for input in '^x\/y/x\/y<pr>$' '^x/y<pr>$' '^x\/y<pr>$'  ; do 
  for flag in "" "-p"; do 
       printf "%s\t%s\t" "$input" "$flag"; lsx-proc $flag forms.lsx.bin <<<"$input"
  done
done
^x\/y/x\/y<pr>$         ^x\/y/x\/y<pr>$
^x\/y/x\/y<pr>$ -p      ^x/y<pr>$ ^x\/y/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$
^x/y<pr>$               ^x\/y<pr>$ ^!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$
^x/y<pr>$       -p      ^x/y<pr>$ ^/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$
^x\/y<pr>$              ^x\/y<pr>$ ^!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$
^x\/y<pr>$      -p      ^x/y<pr>$ ^x\/y<pr>/!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$

from apertium-separable.

mr-martian avatar mr-martian commented on May 30, 2024

Aha, I see the issue now. For internal representation, </> seems decent to me. For XML, if we want it to be another 1 letter tag, I think the remaining letters are cfhknoquvwxyz.

from apertium-separable.

mr-martian avatar mr-martian commented on May 30, 2024

How about <f/>, since it will usually divide a form from a non-form?

from apertium-separable.

unhammer avatar unhammer commented on May 30, 2024

from apertium-separable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.