package io.teknek.topship;

import java.util.Map;

public class SimpleTermExtractor implements TermExtractor{

  @Override
  public Map<String, Long> extractScores(Shop shop) {
    // TODO Auto-generated method stub
    return null;
  }

}

@@ -42,199 +42,1235 @@
 til.
+Hash
 Map;%0A
-%0Apublic class SimpleTermExtractor implements TermExtractor%7B%0A%0A  @Override%0A  public Map%3CString, Long%3E extractScores(Shop shop) %7B%0A    // TODO Auto-generated method stub%0A    return null
+import java.util.Map;%0Aimport java.util.StringTokenizer;%0A%0A/** This is the bare bones thing that works logically but basically %0A * produces nothing useful as it will count a the etc as terms */%0Apublic class SimpleTermExtractor implements TermExtractor%7B%0A%0A  @Override%0A  public Map%3CString, Long%3E extractScores(Shop shop) %7B%0A    Map%3CString,Long%3E termScore = new HashMap%3CString,Long%3E();%0A    for (Item item: shop.getItems())%7B%0A      StringTokenizer st = new StringTokenizer(item.getTitle(), %22 .!,?%22);%0A      while (st.hasMoreTokens())%7B%0A        String token = st.nextToken();%0A        scoreTerm(token, termScore);%0A      %7D%0A      st = new StringTokenizer(item.getDescription(), %22 .!,?%22);%0A      while (st.hasMoreTokens())%7B%0A        String token = st.nextToken();%0A        scoreTerm(token, termScore);%0A      %7D%0A    %7D%0A    return termScore;%0A  %7D%0A%0A  private static void scoreTerm(String term, Map%3CString,Long%3E termScore)%7B%0A    term = term.toLowerCase();%0A    if (term.endsWith(%22's%22))%7B%0A      term = term.replace(%22's%22, %22%22);%0A    %7D%0A    if (term.endsWith(%22%E2%80%99s%22))%7B%0A      term = term.replace(%22%E2%80%99s%22, %22%22);%0A    %7D%0A    if (termScore.containsKey(term))%7B%0A      termScore.put(term, termScore.get(term) + 1L);%0A    %7D else %7B%0A      termScore.put(term, 1L)
 ;%0A  
+ 
+ 
 %7D%0A
+  %7D
 %0A%7D%0A

Use basic tokenizer to extract words