Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设一个语料库有 1k 个文档,并由管道处理。 在某些时候,管道卡住、抛出异常或有有趣的行为。但所有这些很可能与文档相关。 因此,很高兴知道管道中正在处理哪个文档。例如,打印出 Jape 转换器中的文档名称。
要进行文档处理,您可以编写一个简单的 JAPE 规则,例如:
Phase: DocName Input: Token Options: control = once Rule:DocName ( {Token} ) --> { System.out.println(doc.getName()); }
将此规则作为第一条规则放在您的管道中。我希望您在文档中至少有 1 个 Token。