![](/img/trans.png)
[英]What does the interleave_keys() function in torchtext library do exactly?
[英]What does exactly the nextNot function do in SonarQube's library?
您可以在此處看到函數的定義:
* Creates parsing expression - "next not".
* During execution of this expression parser will execute sub-expression once.
* This expression succeeds only if sub-expression fails.
*
* @param e sub-expression
* @throws IllegalArgumentException if given argument is not a parsing expression
*/
public final Object nextNot(Object e) {
return new NextNotExpression(convertToExpression(e));
}
如果我理解正確,如果看到對象e
,它將失敗。
但是,我正在查看SonarQube的Python語法, PRINT_EXP
如下所示:
b.rule(PRINT_STMT).is("print", b.nextNot("("), b.firstOf(
b.sequence(">>", TEST, b.optional(b.oneOrMore(",", TEST), b.optional(","))),
b.optional(TEST, b.zeroOrMore(",", TEST), b.optional(","))));
這是否意味着如果看到括號,則將其視為失敗? 因為在Python 3.x中,print是一個函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.