From 8bded03f5529bd6237b5ea9b82ebe25477b68ae4 Mon Sep 17 00:00:00 2001 From: Justin Humm Date: Mon, 15 May 2017 12:02:58 +0200 Subject: [PATCH] replaced usage of deprecated method removeOverlaps() with ignoreOverlaps in README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index aae0afb..221f2ee 100644 --- a/README.md +++ b/README.md @@ -77,14 +77,14 @@ matches. ```java Trie trie = Trie.builder() - .removeOverlaps() + .ignoreOverlaps() .addKeyword("hot") .addKeyword("hot chocolate") .build(); Collection emits = trie.parseText("hot chocolate"); ``` -The removeOverlaps method tells the Trie to remove all overlapping matches. For this it relies on the following +The ignoreOverlaps method tells the Trie to remove all overlapping matches. For this it relies on the following conflict resolution rules: 1) longer matches prevail over shorter matches, 2) left-most prevails over right-most. There is only one result now: * "hot chocolate" starting at position 0, ending at position 12 @@ -121,7 +121,7 @@ It is also possible to just ask whether the text matches any of the keywords, or finds. ```java - Trie trie = Trie.builder().removeOverlaps() + Trie trie = Trie.builder().ignoreOverlaps() .addKeyword("ab") .addKeyword("cba") .addKeyword("ababc") @@ -161,7 +161,7 @@ matches as soon as you encounter them. Let's look at an example where we want to String speech = "The Answer to the Great Question... Of Life, " + "the Universe and Everything... Is... Forty-two,' said " + "Deep Thought, with infinite majesty and calm."; - Trie trie = Trie.builder().removeOverlaps().onlyWholeWords().caseInsensitive() + Trie trie = Trie.builder().ignoreOverlaps().onlyWholeWords().caseInsensitive() .addKeyword("great question") .addKeyword("forty-two") .addKeyword("deep thought")