问题标签 [openfst]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
613 浏览

python-3.x - 如何通过点文件可视化 Pyfst 传感器

我正在学习如何使用 Pyfst 创建传感器,并且我正在尝试可视化我创建的传感器。最终目标是能够将传感器写入点文件并在 Graphviz 中查看它们。

我拿了一个示例代码来看看如何可视化以下接受器。

当我使用软件包附带的 draw() 时,出现错误:

如果我尝试通过以下方式将上述接受器写入 .dot:

然后我也收到以下错误:

所以,这两个错误看起来都一样——draw() 存在某种问题。在 pyfst 站点上,它说 draw 用于换能器的点格式表示。

我不明白如何修复错误。任何帮助将不胜感激。

我正在使用 OSX 和 PyCharm。

0 投票
1 回答
780 浏览

python - PyFst 安装 Ubuntu 错误命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

使用 Python 2.7.12 和 Ubuntu 16.04.2 LTS,我尝试按照@PyFST Setup CMU的说明安装 OpenFst 和 pyfst,但失败并出现错误

注意:候选人需要 16 个参数,提供 15 个参数 错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

并且还尝试了@PyFST Setup OGI,但失败了

`

错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

看起来 OpenFst 设置正确,因为我能够看到 fst 命令。

fstarcsort fstencode fstprune fstsynchronize fstclosure fstepsnormalize fstpush fsttopsort fstcompile fstequal fstrandgen fstunion fstcompose fstequivalent fstrelabel pdtcompose fstconcat fstinfo fstreplace pdtexpand fstconnect fstintersect fstreverse pdtinfo fstconvert fstinvert fstreweight pdtreplace fstdeterminize fstmap fstrmepsilon pdtreverse fstdifference fstminimize fstshortestdistance pdtshortestpath fstdisambiguate fstprint fstshortestpath fstdraw
fstproject fstsymbols

但是,当我尝试运行时出现此错误sudo pip install pyfst

...(仅包括错误消息的片段,因为比终端窗口长)

/usr/local/include/fst/float-weight.h:在 'static const fst::MinMaxWeightTpl& fst::MinMaxWeightTpl::NoWeight() [with T = float]'的实例化中:/usr/local/include/fst /float-weight.h:615:72: 来自 'fst::MinMaxWeightTpl fst::Plus(const fst::MinMaxWeightTpl&, const fst::MinMaxWeightTpl&) [with T = float]' /usr/local/include/fst /float-weight.h:621:28:从这里需要 /usr/local/include/fst/float-weight.h:576:69:错误:'NumberBad' 不是'fst::FloatLimits'静态的成员const MinMaxWeightTpl no_weight(FloatLimits::NumberBad()); ^ /usr/local/include/fst/float-weight.h: 在 'static const fst::MinMaxWeightTpl& fst::MinMaxWeightTpl::NoWeight() [with T = double]' 的实例化中:

命令“/usr/bin/python -u -c”导入setuptools,tokenize;file ='/tmp/pip-build-DngJ9w/pyfst/setup.py';f=getattr(tokenize, 'open', open)( file );code=f.read().replace('\r\n ', '\n');f.close();exec(compile(code, file , 'exec'))" install --record /tmp/pip-FFhvRI-record/install-record.txt --single- version-externally-managed --compile" 失败,错误代码 1 在 /tmp/pip-build-DngJ9w/pyfst/

或者我尝试以下方法:

这似乎工作正常

/home/wilson/前缀

--2017-05-21 18:37:34-- http://demo.clab.cs.cmu.edu/cdyer/pyfst-0.2.5.tar.gz解决demo.clab.cs.cmu.edu ( demo.clab.cs.cmu.edu)... 128.2.220.95 正在连接到 demo.clab.cs.cmu.edu (demo.clab.cs.cmu.edu)|128.2.220.95|:80... 已连接。HTTP 请求已发送,等待响应... 200 OK 长度:148781 (145K) [application/x-gzip] 保存到:'pyfst-0.2.5.tar.gz.1'</p>

pyfst-0.2.5.tar.gz。100%[===================>] 145.29K 720KB/s 在 0.2s

2017-05-21 18:37:34 (720 KB/s) - 'pyfst-0.2.5.tar.gz.1' 已保存 [148781/148781]

install --prefix=$PREFIX running install running build running build_py running build_ext building 'fst._fst' extension x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-别名 -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c fst/_fst.cpp -o build/temp。 linux-x86_64-2.7/fst/_fst.o -std=c++11 cc1plus:警告:命令行选项“-Wstrict-prototypes”对 C/ObjC 有效,但对 C++ fst/_fst.cpp 无效:在函数中PyObject* __pyx_pf_3fst_4_fst_12StdVectorFst_120draw(__pyx_obj_3fst_4_fst_StdVectorFst*, __pyx_obj_3fst_4_fst_SymbolTable*, __pyx_obj_3fst_4_fst_SymbolTable*, __pyx_obj_3fst_4_fst_SymbolTable*)': fst/_fst.cpp:17681:191: error: no matching function for call to 'fst::FstDrawer >

::FstDrawer(fst::StdVectorFst&, fst::SymbolTable*&, fst::SymbolTable*&, fst::SymbolTable*&, int, std::__cxx11::string&, double, double, int, int, double,双,int,int,int)'ble,__pyx_v_ssyms_table,0,__pyx_t_5,8.5,11.0,1,0,0.40,0.25,14,5,0);^ 在来自 /usr/local/include/fst/script/draw.h:10:0 的文件中,来自 fst/_fst.cpp:242: /usr/local/include/fst/script/draw-impl.h: 29:3:注意:候选:fst::FstDrawer::FstDrawer(const fst::Fst&, const fst::SymbolTable*, const fst::SymbolTable*, const fst::SymbolTable*, bool, const string&, float, float, bool, bool, float, float, int, int, const string&, bool) [with Arc = fst::ArcTpl >; std::__cxx11::string = std::__cxx11::isyms, ^ /usr/local/include/fst/script/draw-impl.h:29:3: 注意:候选人需要 16 个参数,提供 15 个 fst/_fst.cpp:在函数 'PyObject __pyx_pf_3fst_4_fst_12LogVectorFst_120draw(__pyx_obj_3fst_4_fst_LogVectorFst*, __pyx_obj_3fst_4_fst_SymbolTable*, __pyx_obj_3fst_4_fst_SymbolTable*, __pyx_obj_3fst_4_fst_SymbolTable*)': fst/_fst.cpp:30639:191: error: no matching function for call to 'fst::FstDrawer > ::FstDrawer(fst::VectorFst > > &, fst::SymbolTable*&, fst::SymbolTable*&, fst::SymbolTable*&, int, std::__cxx11::string&, double, double, int, int, double, double, int, int, int )' ble, __pyx_v_ssyms_table, 0, __pyx_t_5, 8.5, 11.0, 1, 0, 0.40, 0.25, 14, 5, 0); ^ 在来自 /usr/local/include/fst/script/draw.h:10:0 的文件中,来自 fst/_fst.cpp:242: /usr/local/include/fst/script/draw-impl.h: 29:3:注意:候选人:fst::FstDrawer:: FstDrawer(const fst::Fst&, const fst::SymbolTable*, const fst::SymbolTable*, const fst::SymbolTable*, bool, const string&, float, float, bool, bool, float, float, int, int, const string&, bool) [with Arc = fst::ArcTpl ; std::__cxx11::string = std::__cxx11::basic_string] FstDrawer(const Fst &fst, const SymbolTable *isyms, ^ /usr/local/include/fst/script/draw-impl.h:29:3: 注意:候选人需要 16 个参数,提供 15 个错误:命令“x86_64-linux-gnu-gcc”失败,退出状态为 1

0 投票
0 回答
139 浏览

c++ - OpenFST 传感器的第一步

我是 OpenFST 的新手,正在尝试为 C++ 中的单词创建一个简单的转换器。主要目的是对换能器进行组合并获得两个单词的差异标准。问题是我不知道(也找不到教程)如何为“cat”、“bat”等词制作转换器并编写它。简单的代码不会以最短的方式返回我。我也不清楚 StdArc 的参数。我的代码如下:

谢谢你们的帮助!

0 投票
1 回答
952 浏览

python - 为什么 OpenFST 似乎没有“运行”或“接受”或“转导”命令?

我听说过很多关于 OpenFST 的好消息,但我很难让它发挥作用。我正在构建一个 FST 自动机(fstcompile),我想将其用作接受器来检查一组字符串是否匹配(非常类似于正则表达式,但具有 OpenFST 提供的自动机优化所提供的优势)。事情是这样的:
如何检查生成的自动机是否接受字符串?

我发现了一个建议,将输入字符串变成一个简单的自动机并与接受自动机组合以获得结果。我发现它非常麻烦和奇怪。有没有更简单的方法(通过 cmd 行或 Python/C++)?

0 投票
0 回答
750 浏览

ubuntu - OpenFST on Ubuntu 16.04.3 LTS error installing

Want to install OpenFST 1.6.2. Ran ./configure, make, make check. I get this output. Please advice. Thanks.

// edit ; I moved to CentOS. Installation of Kaldi was a breeze. OpenFST was correctly installed in the process.

0 投票
1 回答
547 浏览

python - 使用 pip 在 Windows 上安装 OpenFST 错误

我想在我的 python 应用程序上使用 openfst python 包装器。

当我跑

对于 Python 3.6 给出了如下错误。

0 投票
0 回答
119 浏览

nlp - OpenFST 创建形态分析器

我想用 OpenFST 为英语创建一个形态分析器(仅用于后缀)。例如,

输入:计算机化

输出:计算 + -er + -ize + -ation + 名词

我的问题是我应该如何使用 shell 命令创建输入和输出符号。有没有办法在 OpenFST 中做到这一点?

0 投票
1 回答
899 浏览

openfst - 用于转换的 Openfst fstcompose

尝试运行我用输入 FSA 编译的 FST,但是当我这样做时没有输出。当我搜索时,openfst 中唯一的运行命令是 fstcompose,所以我尝试做的是将 fst 与输入作为 fsa 组合起来。

代词.fsm.txt

符号.txt

test.fsm.txt

所以我创建了 pronoun.fsm.txt 作为 FST

然后,我将输入创建为接受器

最后,我编写了两个 fst,但输出什么都没有。

这是交易,我想运行一个字符串输入到我用 fstcompose 命令创建的转换器。但是输出是空白的。

0 投票
1 回答
283 浏览

c++ - 为 iOS 编译 OpenFST 时出现转换错误

我正在尝试为 iOS 编译OpenFST,这是 make 失败的地方:

它抛出了许多类似的错误,比如这些

我觉得我在这里使用了错误的 c++ 版本还是什么?

0 投票
0 回答
2619 浏览

c++11 - 如何在 CGO 中包装库(具有 c++11 功能)

  1. 我的操作系统是 Mac,编译器是铿锵声
  2. 我想在 Go 中包装一个 C++ 库(openfst,它使用 C++11 功能)
  3. 我遇到了由 c++11 问题引起的错误。似乎 fstlib.h 包含一些使用 c++11 语法的头文件。
  1. 我尝试export CGO_CFLAGS="-g -O2 -std=c++11 -stdlib=libc++"使用 C++11,但我得到了这个。

以下是所有文件

gost.h

gost.cpp

gofst.go

gofst_test.go

谢谢!