
com.harium.suneidesis.linguistic.matcher.Ends Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Project to represent knowledge
The newest version!
package com.harium.suneidesis.linguistic.matcher;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class Ends implements Matcher {
protected List keywords = new ArrayList<>();
public Ends(List keywords) {
this.keywords.addAll(keywords);
}
public Ends(String... keywords) {
this.keywords.addAll(Arrays.asList(keywords));
}
@Override
public boolean matches(String[] tokens) {
if (keywords.isEmpty()) {
return true;
}
int t = 0;
int cursor = tokens.length-keywords.size();
String keyword = keywords.get(0);
while (cursor keywords.size()) {
return true;
}
t++;
keyword = keywords.get(t);
} else {
return false;
}
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy