GithubHelp home page GithubHelp logo

Comments (14)

mr-martian avatar mr-martian commented on May 31, 2024 1

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.

mr-martian avatar mr-martian commented on May 31, 2024 1

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.

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

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.

hectoralos avatar hectoralos commented on May 31, 2024

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.

hectoralos avatar hectoralos commented on May 31, 2024

@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.

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

@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.

hectoralos avatar hectoralos commented on May 31, 2024

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.

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

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.

hectoralos avatar hectoralos commented on May 31, 2024

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.

mr-martian avatar mr-martian commented on May 31, 2024
$ 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.

hectoralos avatar hectoralos commented on May 31, 2024

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.

hectoralos avatar hectoralos commented on May 31, 2024

@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.

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

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.

hectoralos avatar hectoralos commented on May 31, 2024

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)

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.