Don't allow empty words

This commit is contained in:
Victor Shcherb 2021-02-01 19:49:06 +01:00
parent 3cb9ab9eff
commit 816ed5722b

View file

@ -381,7 +381,12 @@ public class BinaryMapPoiReaderAdapter {
int length = readInt(); int length = readInt();
int oldLimit = codedIS.pushLimit(length); int oldLimit = codedIS.pushLimit(length);
offset = codedIS.getTotalBytesRead(); offset = codedIS.getTotalBytesRead();
List<String> queries = Arrays.asList(query.split(" ")); List<String> queries = new ArrayList<>();
for (String word : query.split(" ")) {
if (word.trim().length() > 0) {
queries.add(word.trim());
}
}
TIntArrayList charsList = new TIntArrayList(queries.size()); TIntArrayList charsList = new TIntArrayList(queries.size());
listOffsets = new ArrayList<TIntArrayList>(queries.size()); listOffsets = new ArrayList<TIntArrayList>(queries.size());
while(listOffsets.size() < queries.size()) { while(listOffsets.size() < queries.size()) {