如何设置该文件的路径

发布于 2024-09-12 11:38:10 字数 1149 浏览 11 评论 0原文

我使用 Sphinx,我已经配置了我的 gammar 模型路径,即 build\class\FYP,

但在我的配置文件中,我只想将 FYP 放入配置组件中

,如下所示

 <component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
    <property name="dictionary" value="dictionary"/>
    <property name="grammarLocation"
         value="resource:/FYP/"/>
    <property name="grammarName" value="word"/>
<property name="logMath" value="logMath"/>
</component>

,但当我想部署应用程序时,所述文件夹会清理并部署jar 文件无法工作,因为它缺少此语法模型。

这是路径 C:\Users\Pradeep\Documents\NetBeansProjects\FYPApplication11

目前具有语法模型。

但是当我这样放置

 <component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
    <property name="dictionary" value="dictionary"/>
    <property name="grammarLocation"
         value="resource:/C:\Users\Pradeep\Documents\NetBeansProjects\FYPApplication11/"/>
    <property name="grammarName" value="word"/>
<property name="logMath" value="logMath"/>
</component>

或使用

\ 行也不起作用

时,有人可以帮助我使这个项目部署为 jar 文件。由于此路径问题,当我在 Netbeans 中部署时,应用程序无法运行

im using Sphinx and i have configured my gammar model path which is build\class\FYP

but in my configuration file i just wanted to put FYP in the configuration component

as follow

 <component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
    <property name="dictionary" value="dictionary"/>
    <property name="grammarLocation"
         value="resource:/FYP/"/>
    <property name="grammarName" value="word"/>
<property name="logMath" value="logMath"/>
</component>

but when i want to deploy the application the said folder cleans and the deployed jar file is not working because of it misses this grammar model.

this is the path
C:\Users\Pradeep\Documents\NetBeansProjects\FYPApplication11

which has the grammar model at the moment.

but when i put like this

 <component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
    <property name="dictionary" value="dictionary"/>
    <property name="grammarLocation"
         value="resource:/C:\Users\Pradeep\Documents\NetBeansProjects\FYPApplication11/"/>
    <property name="grammarName" value="word"/>
<property name="logMath" value="logMath"/>
</component>

or using

\ lines also didnt work

can someone help me to make this project to deploy as a jar file. because of this path issue the application is not working when i deploy in Netbeans

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巾帼英雄 2024-09-19 11:38:10

根据文档,“grammerLocation”属性可以采用两种类型的值:

  • 资源定位器(对于 jar、类路径中的资源)
  • URL

因此,在 Windows 上,在您的情况下,您可以执行以下操作:

<component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
    <property name="dictionary" value="dictionary"/>
    <property name="grammarLocation" value="file:/C:/Users/Pradeep/Documents/NetBeansProjects/FYPApplication11/"/>
    <property name="grammarName" value="word"/>
    <property name="logMath" value="logMath"/>
</component>

According to the documentation, the "grammerLocation" property can take two types of values:

  • A resource locator (for resources in jars, classpath)
  • A URL

So on windows, in your case you can do:

<component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
    <property name="dictionary" value="dictionary"/>
    <property name="grammarLocation" value="file:/C:/Users/Pradeep/Documents/NetBeansProjects/FYPApplication11/"/>
    <property name="grammarName" value="word"/>
    <property name="logMath" value="logMath"/>
</component>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文