Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Optional<Map.Entry<O, Option>> matchOption = optionMap.entrySet().stream()
- .filter(option -> {
- List<String> recognitionList = recognition.stream()
- .map(PlayCollectSpeech.Speech.Entry::getText)
- .map(String::toLowerCase)
- .flatMap(entryText -> {
- List<String> stringList = new ArrayList<>(Arrays.asList(entryText.split(" ")));
- return stringList.stream();
- }).collect(Collectors.toList());
- boolean isFound = false;
- for (String split : recognitionList) {
- if (split.equals(option.getValue().getId())
- || split.equals(option.getValue().getLocalizedVariants(locale).stream()
- .filter(split::equals).findAny().orElse(""))) {
- isFound = true;
- }
- }
- return isFound;
- }
- )
- .findFirst();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement