alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.37k stars 1.04k forks source link

error: use of undeclared identifier 'WordAlignLatticePartial'; did you mean 'WordAlignLattice'? #1484

Closed yurivict closed 6 months ago

yurivict commented 6 months ago

Build fails:

[ 66% 5/6] /usr/local/libexec/ccache/c++  -isystem /usr/local/include/kaldi -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -std=c++17 -pthread -MD -MT CMakeFiles/vosk.dir/src/recognizer.cc.o -MF CMakeFiles/vosk.dir/src/recognizer.cc.o.d -o CMakeFiles/vosk.dir/src/recognizer.cc.o -c /usr/ports/audio/vosk-api/work/vosk-api-aba8497/src/recognizer.cc
FAILED: CMakeFiles/vosk.dir/src/recognizer.cc.o 
/usr/local/libexec/ccache/c++  -isystem /usr/local/include/kaldi -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -DNDEBUG -std=c++17 -pthread -MD -MT CMakeFiles/vosk.dir/src/recognizer.cc.o -MF CMakeFiles/vosk.dir/src/recognizer.cc.o.d -o CMakeFiles/vosk.dir/src/recognizer.cc.o -c /usr/ports/audio/vosk-api/work/vosk-api-aba8497/src/recognizer.cc
/usr/ports/audio/vosk-api/work/vosk-api-aba8497/src/recognizer.cc:847:13: error: use of undeclared identifier 'WordAlignLatticePartial'; did you mean 'WordAlignLattice'?
            WordAlignLatticePartial(clat, *model_->trans_model_, *model_->winfo_, 0, &aligned_lat);
            ^~~~~~~~~~~~~~~~~~~~~~~
            WordAlignLattice
/usr/local/include/kaldi/lat/word-align-lattice.h:191:6: note: 'WordAlignLattice' declared here
bool WordAlignLattice(const CompactLattice &lat,
     ^
1 error generated.

rev. aba8497 kaldi rev. 21ae411 (last revision, there are no tags in the repository) clang-16 FreeBSD 13.2

nshmyrev commented 6 months ago

You have to use vosk branch in alphacep/kaldi, not master branch. See the build scripts.

yurivict commented 6 months ago

@nshmyrev

The vosk branch in alphacep/kaldi fails to build:

In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/grammar-context-fst.cc:20:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/grammar-context-fst.h:51:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/deterministic-fst.h:333:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/deterministic-fst-inl.h:25:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/fstext-utils.h:425:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/fstext-utils-inl.h:29:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/pre-determinize.h:94:
/usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/pre-determinize-inl.h:238:21: error: no type named 'iterator' in 'fst::SymbolTable'
  for (SymbolTable::iterator siter = symTable->begin(); siter != symTable->end(); ++siter) {
       ~~~~~~~~~~~~~^
/usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/pre-determinize-inl.h:238:48: error: no member named 'begin' in 'fst::SymbolTable'
  for (SymbolTable::iterator siter = symTable->begin(); siter != symTable->end(); ++siter) {
                                     ~~~~~~~~  ^
/usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/pre-determinize-inl.h:238:76: error: no member named 'end' in 'fst::SymbolTable'
  for (SymbolTable::iterator siter = symTable->begin(); siter != symTable->end(); ++siter) {
                                                                 ~~~~~~~~  ^
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/grammar-context-fst.cc:20:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/grammar-context-fst.h:51:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/deterministic-fst.h:333:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/deterministic-fst-inl.h:25:
In file included from /usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/fstext-utils.h:425:
/usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/fstext-utils-inl.h:378:21: error: no type named 'iterator' in 'fst::SymbolTable'
  for (SymbolTable::iterator iter = symtab.begin();
       ~~~~~~~~~~~~~^
/usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/fstext-utils-inl.h:378:44: error: no member named 'begin' in 'fst::SymbolTable'
  for (SymbolTable::iterator iter = symtab.begin();
                                    ~~~~~~ ^
/usr/ports/audio/kaldi-vosk/work/kaldi-2b69aed/src/fstext/../fstext/fstext-utils-inl.h:379:22: error: no member named 'end' in 'fst::SymbolTable'
      iter != symtab.end();
              ~~~~~~ ^
6 errors generated.

openfst-1.8.2.20221207 clang-16 FreeBSD 13.2

nshmyrev commented 6 months ago

You need to use our openfst as well, see the build instructions:

https://github.com/alphacep/vosk-api/blob/master/travis/Dockerfile.manylinux

nshmyrev commented 6 months ago

Same as #1082