将列表添加到阿拉伯语插件地名词典时加载列表时出错

Error loading list when adding a list to Arabic plugin gazetteer

我试图向阿拉伯语插件地名词典添加一个新列表。 我遵循了以下步骤:

  1. 创建一个新文件 "tags.lst" 到目录 "GATE_Developer_8.1\plugins\Lang_Arabic\resources\gazetteer\"
  2. 在 "lists.def" 文件中附加:"tags.lst:tags::arabic"

启动门控软件时,window 弹出消息如下:

Resource could not be created!

gate.creole.ResourceInstantiationException: gate.util.GateRuntimeException: Error loading list: tags.lst: java.io.IOException: The system cannot find the path specified.

这里是完整的例外:

gate.creole.ResourceInstantiationException: gate.util.GateRuntimeException: Error loading list: tags.lst: java.io.IOException: The system cannot find the path specified
    at gate.creole.gazetteer.LinearDefinition.load(LinearDefinition.java:281)
    at gate.creole.gazetteer.DefaultGazetteer.init(DefaultGazetteer.java:119)
    at gate.Factory.createResource(Factory.java:432)
    at gate.gui.NewResourceDialog.run(NewResourceDialog.java:257)
    at java.lang.Thread.run(Thread.java:745)
Caused by: gate.util.GateRuntimeException: Error loading list: tags.lst: java.io.IOException: The system cannot find the path specified
    at gate.creole.gazetteer.LinearDefinition.add(LinearDefinition.java:527)
    at gate.creole.gazetteer.LinearDefinition.load(LinearDefinition.java:276)
    ... 4 more
Caused by: gate.creole.ResourceInstantiationException: java.io.IOException: The system cannot find the path specified
    at gate.creole.gazetteer.LinearDefinition.loadSingleList(LinearDefinition.java:199)
    at gate.creole.gazetteer.LinearDefinition.loadSingleList(LinearDefinition.java:158)
    at gate.creole.gazetteer.LinearDefinition.add(LinearDefinition.java:520)
    ... 5 more
Caused by: java.io.IOException: The system cannot find the path specified
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)
    at java.io.File.createNewFile(File.java:1012)
    at gate.creole.gazetteer.LinearDefinition.loadSingleList(LinearDefinition.java:188)
    ... 7 more

我会很感激任何帮助??

问题是由两个主要问题引起的:

  1. 文件未正确保存为 utf-8 编码,已使用在线转换器解决:http://www.motobit.com/util/charset-codepage-conversion.asp

  2. 该文件包含使用以下 replaceAll 正则表达式 [#|"|:] 解析的特殊字符:

line = line.replaceAll("[#|\"|:]", " ");