[GitHub] [lucene-solr] jpountz commented on a change in pull request #786: LUCENE-8916: GraphTokenStreamFiniteStrings preserves all incoming attributes

2019-07-16 Thread GitBox
jpountz commented on a change in pull request #786: LUCENE-8916: 
GraphTokenStreamFiniteStrings preserves all incoming attributes
URL: https://github.com/apache/lucene-solr/pull/786#discussion_r303849314
 
 

 ##
 File path: 
lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java
 ##
 @@ -44,13 +48,13 @@ private void assertTokenStream(TokenStream ts, String[] 
terms, int[] increments)
 assertNotNull(terms);
 assertNotNull(increments);
 assertEquals(terms.length, increments.length);
-BytesTermAttribute termAtt = ts.getAttribute(BytesTermAttribute.class);
+CharTermAttribute termAtt = ts.getAttribute(CharTermAttribute.class);
 PositionIncrementAttribute incrAtt = 
ts.getAttribute(PositionIncrementAttribute.class);
 int offset = 0;
 while (ts.incrementToken()) {
   // verify term and increment
   assert offset < terms.length;
-  assertEquals(terms[offset], termAtt.getBytesRef().utf8ToString());
+  assertEquals(terms[offset], termAtt.toString());
 
 Review comment:
   ok thanks, I was confusing BytesTermAttribute with TermToBytesRefAttribute


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] jpountz commented on a change in pull request #786: LUCENE-8916: GraphTokenStreamFiniteStrings preserves all incoming attributes

2019-07-16 Thread GitBox
jpountz commented on a change in pull request #786: LUCENE-8916: 
GraphTokenStreamFiniteStrings preserves all incoming attributes
URL: https://github.com/apache/lucene-solr/pull/786#discussion_r303849314
 
 

 ##
 File path: 
lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java
 ##
 @@ -44,13 +48,13 @@ private void assertTokenStream(TokenStream ts, String[] 
terms, int[] increments)
 assertNotNull(terms);
 assertNotNull(increments);
 assertEquals(terms.length, increments.length);
-BytesTermAttribute termAtt = ts.getAttribute(BytesTermAttribute.class);
+CharTermAttribute termAtt = ts.getAttribute(CharTermAttribute.class);
 PositionIncrementAttribute incrAtt = 
ts.getAttribute(PositionIncrementAttribute.class);
 int offset = 0;
 while (ts.incrementToken()) {
   // verify term and increment
   assert offset < terms.length;
-  assertEquals(terms[offset], termAtt.getBytesRef().utf8ToString());
+  assertEquals(terms[offset], termAtt.toString());
 
 Review comment:
   ok


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[GitHub] [lucene-solr] jpountz commented on a change in pull request #786: LUCENE-8916: GraphTokenStreamFiniteStrings preserves all incoming attributes

2019-07-16 Thread GitBox
jpountz commented on a change in pull request #786: LUCENE-8916: 
GraphTokenStreamFiniteStrings preserves all incoming attributes
URL: https://github.com/apache/lucene-solr/pull/786#discussion_r303816286
 
 

 ##
 File path: 
lucene/core/src/test/org/apache/lucene/util/graph/TestGraphTokenStreamFiniteStrings.java
 ##
 @@ -44,13 +48,13 @@ private void assertTokenStream(TokenStream ts, String[] 
terms, int[] increments)
 assertNotNull(terms);
 assertNotNull(increments);
 assertEquals(terms.length, increments.length);
-BytesTermAttribute termAtt = ts.getAttribute(BytesTermAttribute.class);
+CharTermAttribute termAtt = ts.getAttribute(CharTermAttribute.class);
 PositionIncrementAttribute incrAtt = 
ts.getAttribute(PositionIncrementAttribute.class);
 int offset = 0;
 while (ts.incrementToken()) {
   // verify term and increment
   assert offset < terms.length;
-  assertEquals(terms[offset], termAtt.getBytesRef().utf8ToString());
+  assertEquals(terms[offset], termAtt.toString());
 
 Review comment:
   Was this change necessary, it should be equivalent right?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org