Comments (7)
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.
$ 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.
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.
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.
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.
How about <f/>
, since it will usually divide a form from a non-form?
from apertium-separable.
from apertium-separable.
Related Issues (20)
- README says zlib is required, configure.ac doesn't; which is right? HOT 6
- let's drop --enable-debug? everyone else just overrides C{,XX}FLAGS
- Issue with blanks HOT 2
- Outputs extra chars HOT 14
- LU doesn't delete after combining HOT 5
- Needs Python 2to3 conversion
- Compile error because of missing method HOT 2
- lsx-proc eats final blank
- Error: Trying to link nonexistent states HOT 3
- How to keep caps? HOT 6
- rule-initial <w/> can make other rules match HOT 1
- Is it possible to enforce a space? HOT 7
- lsx-comp compiling error HOT 4
- lsx-comp not running as before HOT 4
- apertium-filter-rules for lsx files HOT 14
- weights HOT 2
- Tags on individual unchanged LU's are spread across the whole matching rule HOT 4
- Can't compile on Manjaro linux ARM HOT 3
- lsx-comp --trace option that inserts (top-level rule) line numbers in output HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apertium-separable.