rzo1 commented on code in PR #1520:
URL: https://github.com/apache/opennlp/pull/1520#discussion_r4440808739


##########
opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/depparse/DependencyContextGenerator.java:
##########
@@ -276,6 +283,34 @@ private String valueAt(String[] values, int index) {
     return index == ArcStandardState.NONE ? NONE_VALUE : values[index];
   }
 
+  /**
+   * Prefixes every {@link #ESCAPE}, {@link #WORD_TAG_SEPARATOR}, and
+   * {@link #POSITION_SEPARATOR} in a value with {@link #ESCAPE}, so that a 
combined
+   * feature of several positions is read back unambiguously and cannot 
collide with the

Review Comment:
   Nothing reads this back. "stays unambiguous"?



##########
opennlp-core/opennlp-runtime/src/main/java/opennlp/tools/depparse/DependencyContextGenerator.java:
##########
@@ -276,6 +283,34 @@ private String valueAt(String[] values, int index) {
     return index == ArcStandardState.NONE ? NONE_VALUE : values[index];
   }
 
+  /**
+   * Prefixes every {@link #ESCAPE}, {@link #WORD_TAG_SEPARATOR}, and
+   * {@link #POSITION_SEPARATOR} in a value with {@link #ESCAPE}, so that a 
combined
+   * feature of several positions is read back unambiguously and cannot 
collide with the
+   * same feature built from other values. The common case, a value with none 
of these
+   * characters, returns the value unchanged.
+   *
+   * @param value The value to escape. Must not be {@code null}.
+   * @return The escaped value, or {@code value} if it has nothing to escape.
+   */
+  private static String escape(String value) {

Review Comment:
   Doesn't need to be static, the other helpers aren't.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to