From 10b59654b7d99c3f2af9512e343c9a4da1bffe41 Mon Sep 17 00:00:00 2001 From: robert-bor Date: Wed, 29 Jan 2014 21:58:22 +0100 Subject: [PATCH] More explanation on the usage --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5afff4a..97dd74b 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,13 @@ Some examples you could use the Aho-Corasick algorithm for: * checking against a dictionary to see if syntactic errors were made This library is the Java implementation of the afore-mentioned Aho-Corasick algorithm for efficient string matching. -The algorithm is explained in great detail in the white paper written by Aho and Corasick: -ftp://163.13.200.222/assistant/bearhero/prog/%A8%E4%A5%A6/ac_bm.pdf. +The algorithm is explained in great detail in the white paper written by +[Aho and Corasick](ftp://163.13.200.222/assistant/bearhero/prog/%A8%E4%A5%A6/ac_bm.pdf). Usage ----- +Setting up the Trie is a piece of cake: ```java Trie trie = new Trie(); trie.addKeyword("hers"); @@ -48,6 +49,11 @@ Usage Collection emits = trie.parseText("ushers"); ``` +You can now read the set. In this case it will find the following: +* "she" at position 3 +* "he" at position 3 +* "hers" at position 5 + License ------- Licensed under the Apache License, Version 2.0 (the "License");