com.bericotech.clavin
Class GeoParserFactory

java.lang.Object
  extended by com.bericotech.clavin.GeoParserFactory

public class GeoParserFactory
extends Object

Simple Factory for the creation of GeoParser instances. The 'default' instance being Apache OpenNLP as the Extractor and a local Lucene index as the LocationResolver.


Constructor Summary
GeoParserFactory()
           
 
Method Summary
static GeoParser getDefault(String pathToLuceneIndex)
          Get the default GeoParser, with maxHitDepth and maxContentWindow both set to 1, and fuzzy matching turned off.
static GeoParser getDefault(String pathToLuceneIndex, boolean fuzzy)
          Get a GeoParser with fuzzy matching explicitly turned on or off.
static GeoParser getDefault(String pathToLuceneIndex, int maxHitDepth, int maxContentWindow)
          Get a GeoParser with defined values for maxHitDepth and maxContentWindow.
static GeoParser getDefault(String pathToLuceneIndex, int maxHitDepth, int maxContentWindow, boolean fuzzy)
          Get a GeoParser with defined values for maxHitDepth and maxContentWindow, and fuzzy matching explicitly turned on or off.
static GeoParser getDefault(String pathToLuceneIndex, LocationExtractor extractor, int maxHitDepth, int maxContentWindow, boolean fuzzy)
          Get a GeoParser with defined values for maxHitDepth and maxContentWindow, fuzzy matching explicitly turned on or off, and a specific LocationExtractor to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoParserFactory

public GeoParserFactory()
Method Detail

getDefault

public static GeoParser getDefault(String pathToLuceneIndex)
                            throws IOException,
                                   org.apache.lucene.queryparser.classic.ParseException
Get the default GeoParser, with maxHitDepth and maxContentWindow both set to 1, and fuzzy matching turned off.

Parameters:
pathToLuceneIndex - Path to the local Lucene index.
Returns:
GeoParser
Throws:
IOException - If file isn't found or can't be read.
org.apache.lucene.queryparser.classic.ParseException

getDefault

public static GeoParser getDefault(String pathToLuceneIndex,
                                   boolean fuzzy)
                            throws IOException,
                                   org.apache.lucene.queryparser.classic.ParseException
Get a GeoParser with fuzzy matching explicitly turned on or off.

Parameters:
pathToLuceneIndex - Path to the local Lucene index.
fuzzy - Should fuzzy matching be used?
Returns:
GeoParser
Throws:
IOException - If file isn't found or can't be read.
org.apache.lucene.queryparser.classic.ParseException

getDefault

public static GeoParser getDefault(String pathToLuceneIndex,
                                   int maxHitDepth,
                                   int maxContentWindow)
                            throws IOException,
                                   org.apache.lucene.queryparser.classic.ParseException
Get a GeoParser with defined values for maxHitDepth and maxContentWindow.

Parameters:
pathToLuceneIndex - Path to the local Lucene index.
maxHitDepth - Number of candidate matches to consider
maxContentWindow - How much context to consider when resolving
Returns:
GeoParser
Throws:
IOException - If file isn't found or can't be read.
org.apache.lucene.queryparser.classic.ParseException

getDefault

public static GeoParser getDefault(String pathToLuceneIndex,
                                   int maxHitDepth,
                                   int maxContentWindow,
                                   boolean fuzzy)
                            throws IOException,
                                   org.apache.lucene.queryparser.classic.ParseException
Get a GeoParser with defined values for maxHitDepth and maxContentWindow, and fuzzy matching explicitly turned on or off.

Parameters:
pathToLuceneIndex - Path to the local Lucene index.
maxHitDepth - Number of candidate matches to consider
maxContentWindow - How much context to consider when resolving
fuzzy - Should fuzzy matching be used?
Returns:
GeoParser
Throws:
IOException - If file isn't found or can't be read.
org.apache.lucene.queryparser.classic.ParseException

getDefault

public static GeoParser getDefault(String pathToLuceneIndex,
                                   LocationExtractor extractor,
                                   int maxHitDepth,
                                   int maxContentWindow,
                                   boolean fuzzy)
                            throws IOException,
                                   org.apache.lucene.queryparser.classic.ParseException
Get a GeoParser with defined values for maxHitDepth and maxContentWindow, fuzzy matching explicitly turned on or off, and a specific LocationExtractor to use.

Parameters:
pathToLuceneIndex - Path to the local Lucene index.
extractor - A specific implementation of LocationExtractor to be used
maxHitDepth - Number of candidate matches to consider
maxContentWindow - How much context to consider when resolving
fuzzy - Should fuzzy matching be used?
Returns:
GeoParser
Throws:
IOException - If file isn't found or can't be read.
org.apache.lucene.queryparser.classic.ParseException


Copyright © 2013 Berico Technologies. All rights reserved.