
com.harium.suneidesis.linguistic.matcher.Or 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 Or implements Matcher {
protected List matchers = new ArrayList<>();
public Or(List matchers) {
this.matchers.addAll(matchers);
}
public Or(Matcher... matchers) {
this.matchers.addAll(Arrays.asList(matchers));
}
@Override
public boolean matches(String[] tokens) {
if (matchers.isEmpty()) {
return true;
}
for (Matcher matcher : matchers) {
if (matcher.matches(tokens)) {
return true;
}
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy