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.
static GeoParser getDefault(String pathToLuceneIndex, boolean fuzzy)
          Get the default GeoParser.
static GeoParser getDefault(String pathToLuceneIndex, int maxHitDepth, int maxContentWindow)
          Get the default GeoParser.
static GeoParser getDefault(String pathToLuceneIndex, int maxHitDepth, int maxContentWindow, boolean fuzzy)
          Get the default GeoParser.
static GeoParser getDefault(String pathToLuceneIndex, LocationExtractor extractor, int maxHitDepth, int maxContentWindow, boolean fuzzy)
          Get the default GeoParser.
 
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.

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 the default GeoParser.

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 the default GeoParser.

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 the default GeoParser.

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 the default GeoParser.

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.