Comments (14)
I meant that I thought lsx-comp
had a command-line option equivalent to lt-comp
's -v
option, so the recipe would just be
lsx-comp -v oci apertium-oci-fra.oci-fra.l1x oci-fra.autosep1.bin
In fact it has all the code for that and the argument just hasn't been added yet - I can do that tonight or tomorrow.
from apertium-separable.
so, because command-line argument parsing is terrible, -v="oci@gascon"
selects the variant =oci@gascon
while -v "oci@gascon"
selects the variant oci@gascon
. I think --var="oci@gascon"
would do oci@gascon
, but my local copy isn't compiling with --
options for some reason, so I can't double check that at the moment.
from apertium-separable.
It looks to me like lsx-comp
should already support direction restrictions the same way lt-comp
does - I don't think it filters on <pardef>
though.
from apertium-separable.
There is probably a bug. There isn't any syntactical error when I add a v="oci"
to an <e>
statement, but the output file is almost empty:
$ make
apertium-filter-rules oci apertium-oci-fra.oci-fra.l1x >.deps/oci-fra.l1x
lsx-comp lr .deps/oci-fra.l1x oci-fra.autosep1.bin
.deps/oci-fra.l1x:32: parser error : Document is empty
pas
^
Error: Parse error at the end of input.
As for adding a filter to <pardef>
, I'm not really sure if it could be needed. I would add it just in case if adding it at the same time as to <e>
is easy.
from apertium-separable.
@mr-martian, couldn't you find time for this? It would be helpful (I dare to insist because you said "tonight or tomorrow").
from apertium-separable.
@hectoralos sorry I totally forgot about this. It's done and should be in the nightly builder in a few hours I think.
from apertium-separable.
Unfortunately, there are no changes after installing the nightly builder:
$ make
apertium-filter-rules oci apertium-oci-fra.oci-fra.l1x >.deps/oci-fra.l1x
lsx-comp lr .deps/oci-fra.l1x oci-fra.autosep1.bin
.deps/oci-fra.l1x:32: parser error : Document is empty
pas
^
Error: Parse error at the end of input.
from apertium-separable.
Sorry for the lack of clarity, the change is that lsx-comp
now has the same -v
option as lt-comp
rather than adding it to apertium-filter-rules
.
from apertium-separable.
Sorry, but I can't see how it works. I have to specify somewhere the filter (oci
or oci@gascon
, in my case). If I do
$ lsx-comp -h
USAGE: lsx-comp [ -v ] [direction] dictionary_file(s) output_bin_file
-v, --var: specify language variant
-h, --help: print this help and exit
Directions:
lr: left-to-right compilation
rl: right-to-left compilation
There is no information.
(Besides, if I run lsx-comp
without anything, I get a core dump.)
If I run It-comp
, I don't get any information too about any v
parameter for the language variety. So I went to see what is done in the Catalan dictionaries, and I see:
$(PREFIX1C).autobil.bin: .deps/$(PREFIX1).cat.dix
apertium-validate-dictionary $<
lt-comp --var-right=cat lr $< $@
So it seems this is --var-right
or something the like. Should I use --var-right
or --var-left
? I can see any significance of right of left for language in lsx-comp
.
from apertium-separable.
$ lt-comp -h
lt-comp v3.6.2: build a letter transducer from a dictionary
USAGE: lt-comp [-mavhlr] lr | rl dictionary_file output_file [acx_file]
-m, --keep-boundaries: keep morpheme boundaries
-v, --var: set language variant
-a, --alt: set alternative (monodix)
-l, --var-left: set left language variant (bidix)
-r, --var-right: set right language variant (bidix)
-H, --hfst: expect HFST symbols
-S, --no-split: don't attempt to split into word and punctuation transducers
Modes:
lr: left-to-right compilation
rl: right-to-left compilation
Since you're using lsx in a pair, it probably makes sense to add --var-right
and --var-left
in case something depends both on which variety you're translating from and which one you're translating into, but at the moment you should be able to do
<e v="oci"> ... </e>
lsx-comp --var oci lr apertium-oci-fra.oci-fra.l1x oci-fra.autosep1.bin
from apertium-separable.
Excellent! It's working. Thanks a lot.
As for --var-right
and --var-left
, according to the pipeline, the module will be used in places where there is information about one single language. But maybe, someone could find useful to use it in another place. In any case, they don't hurt.
from apertium-separable.
@mr-martian , I have a problem. I have this rule:
<e lm="far mestièr">
<p><l>far<s n="vblex"/></l><r>far<g><b/>mestièr</g><s n="vblex"/></r></p>
<i><t/><d/></i>
<par n="adv"/>
<p><l>mestièr<s n="n"/><s n="m"/><s n="sg"/><d/></l><r></r></p>
</e>
I compile:
$ make
lsx-comp lr -v="oci" apertium-oci-fra.oci-fra.l1x oci-fra.autosep1.bin
main@standard 2600 3655
I run a test:
$ echo "^far<vblex><imp><p2><sg>$ ^pas<adv>$ ^mestièr<n><m><sg>$" | lsx-proc '/home/hector/apertium/apertium-oci-fra/oci-fra.autosep1.bin'
^far# mestièr<vblex><imp><p2><sg>$ ^pas<adv>$
It is working.
Now I add v="oci"
:
<e lm="far mestièr" v="oci">
<p><l>far<s n="vblex"/></l><r>far<g><b/>mestièr</g><s n="vblex"/></r></p>
<i><t/><d/></i>
<par n="adv"/>
<p><l>mestièr<s n="n"/><s n="m"/><s n="sg"/><d/></l><r></r></p>
</e>
I compile:
$ make
lsx-comp lr -v="oci" apertium-oci-fra.oci-fra.l1x oci-fra.autosep1.bin
main@standard 2590 3638
I run the same test:
$ echo "^far<vblex><imp><p2><sg>$ ^pas<adv>$ ^mestièr<n><m><sg>$" | lsx-proc '/home/hector/apertium/apertium-oci-fra/oci-fra.autosep1.bin'
^far<vblex><imp><p2><sg>$ ^pas<adv>$ ^mestièr<n><m><sg>$
It is not working.
Any idea?
from apertium-separable.
The -v=oci
part has to be before the lr
due to the way command-line options are parsed. If I switch the order of those it fixes the issue for me.
from apertium-separable.
This is really strange because I still have the same problem after putting -v="oci"
before lr
:
$ make
lsx-comp -v="oci" lr apertium-oci-fra.oci-fra.l1x oci-fra.autosep1.bin
main@standard 2590 3638
lsx-comp -v="oci@gascon" lr apertium-oci-fra.oci-fra.l1x [email protected]
main@standard 2590 3638
$ echo "^far<vblex><imp><p2><sg>$ ^pas<adv>$ ^mestièr<n><m><sg>$" | lsx-proc '/home/hector/apertium/apertium-oci-fra/oci-fra.autosep1.bin'
^far<vblex><imp><p2><sg>$ ^pas<adv>$ ^mestièr<n><m><sg>$
from apertium-separable.
Related Issues (20)
- Add a way to copy tags in output HOT 1
- Issue with capital letters HOT 5
- 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
- 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
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.