Coder Social home page Coder Social logo

Comments (13)

jtrmal avatar jtrmal commented on July 27, 2024 1

from openfst.

kkm000 avatar kkm000 commented on July 27, 2024 1

It's supposed to be more portable, although it's not required by the standard and left to the implementation as to which mode can or cannot be changed. But IIRC, it worked with MSVC. I'll check and let you know.

from openfst.

daanzu avatar daanzu commented on July 27, 2024

FYI, I fixed this issue, at least for my use cases. The changes are small, but spread out. @kkm000 Do you want a PR, or is it not important enough?

from openfst.

brucelin avatar brucelin commented on July 27, 2024

FYI, I fixed this issue, at least for my use cases. The changes are small, but spread out. @kkm000 Do you want a PR, or is it not important enough?

I may meet the same problem when I use kaldi under the cygwin enviroment, can u show your solution. Thank you very much. Below is my case

utils/make_lexicon_fst.pl --pron-probs $tmpdir/lexiconp.txt $sil_prob $silphone | \
    fstcompile --isymbols=$dir/phones.txt --osymbols=$dir/words.txt \
    --keep_isymbols=false --keep_osymbols=false | \
     fstarcsort --sort_type=olabel > $dir/L.fst || exit 1;

and the error information

ERROR: GenericRegister::GetEntry: No such file or directory
ERROR: MutableFst::Read: Unknown FST type "vector" (arc type = "standard"): standard input

from openfst.

daanzu avatar daanzu commented on July 27, 2024

Oops, I've been lax in sending this in. I'll try to post it today.

from openfst.

daanzu avatar daanzu commented on July 27, 2024

@brucelin Should be fixed in #23. Also, some binaries with this fix are available if you download and unpack (with zip) the wheels for https://github.com/daanzu/kaldi-active-grammar.

from openfst.

brucelin avatar brucelin commented on July 27, 2024

@daanzu Thank you very much. I will try it.

from openfst.

kkm000 avatar kkm000 commented on July 27, 2024

Thanks for discovering the issue and the patch, and I'm sorry--was really busy last couple months.

I remember there was a way to deal with the text/binary streams using std::freopen, do you think it would be a better approach if it works?

If filename is a null pointer, then the function attempts to reopen the file that is already associated with stream (it is implementation defined which mode changes are allowed in this case)

So it should be like std::freopen(nullptr, "wb", stdout);. I recall it did the trick.

from openfst.

daanzu avatar daanzu commented on July 27, 2024

Neat, I don't recall knowing about the std::freopen approach. It's been awhile since I wrote the patch, so I can't remember exactly why I chose this approach. I can say that it appears to have been working perfectly for me for the past 7 months, however.

from openfst.

kkm000 avatar kkm000 commented on July 27, 2024

Blocked-By: #30

from openfst.

kkm000 avatar kkm000 commented on July 27, 2024

Repro:

$ printf '0 1 10 10\n1\n' | fstcompile | xxd -u -s64

Linux output (ok):

00000040: 0000 0000 807F 0100 0000 0000 0000 0A00
00000050: 0000 0A00 0000 0000 0000 0100 0000 0000
00000060: 0000 0000 0000 0000 0000

Windows output (bug):

00000040: 0000 0000 807F 0100 0000 0000 0000 0D0A
00000050: 0000 000D 0A00 0000 0000 0000 0100 0000
00000060: 0000 0000 0000 0000 0000 0000

from openfst.

kkm000 avatar kkm000 commented on July 27, 2024

Repro 2. On a Windows machine, save the binary generated by fstcompile:

$  printf '0 1 10 10\n1\n'
0 1 10 10
1
$ printf '0 1 10 10\n1\n' | fstcompile | gzip | base64 -w0                                                             
H4sIAAAAAAAAA7v2d1MdGwMDQ1lqckl+EQeQVVySmJeSWJTCxAABzAyNUVkMCMDEgA4a6hmhLF4uGAECjGgqAUmO7J5sAAAA

Switch to Linux terminal, and do the reverse, unencode, ungzip, fstprint:

$ echo 'H4sIAAAAAAAAA7v2d1MdGwMDQ1lqckl+EQeQVVySmJeSWJTCxAABzAyNUVkMCMDEgA4a6hmhLF4uGAECjGgqAUmO7J5sAAAA' | base64 -d | gunzip | ./fstprint
0       65536   2573    658688
1

The result is nonsense.

from openfst.

kkm000 avatar kkm000 commented on July 27, 2024

Fixed in #32

from openfst.

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.