Package org.apache.tika.parser.geo.topic
Class GeoParser
- java.lang.Object
-
- org.apache.tika.parser.AbstractParser
-
- org.apache.tika.parser.geo.topic.GeoParser
-
- All Implemented Interfaces:
Serializable,org.apache.tika.parser.Parser
public class GeoParser extends org.apache.tika.parser.AbstractParser- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GeoParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetGazetteerRestEndpoint()URLgetNerModelUrl()Set<org.apache.tika.mime.MediaType>getSupportedTypes(org.apache.tika.parser.ParseContext parseContext)voidinitialize(GeoParserConfig geoParserConfig)Initializes this parserbooleanisAvailable(GeoParserConfig geoParserConfig)voidparse(InputStream stream, ContentHandler handler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext context)Map<String,List<Location>>searchGeoNames(ArrayList<String> locationNameEntities)voidsetGazetteerRestEndpoint(String gazetteerRestEndpoint)voidsetNerModelUrl(String nerModelUrl)
-
-
-
Method Detail
-
getSupportedTypes
public Set<org.apache.tika.mime.MediaType> getSupportedTypes(org.apache.tika.parser.ParseContext parseContext)
-
initialize
public void initialize(GeoParserConfig geoParserConfig)
Initializes this parser- Parameters:
geoParserConfig- config to load the url model from and set the gazetteer client
-
parse
public void parse(InputStream stream, ContentHandler handler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext context) throws IOException, SAXException, org.apache.tika.exception.TikaException
- Throws:
IOExceptionSAXExceptionorg.apache.tika.exception.TikaException
-
searchGeoNames
public Map<String,List<Location>> searchGeoNames(ArrayList<String> locationNameEntities)
-
isAvailable
public boolean isAvailable(GeoParserConfig geoParserConfig)
-
getGazetteerRestEndpoint
public String getGazetteerRestEndpoint()
-
setGazetteerRestEndpoint
@Field public void setGazetteerRestEndpoint(String gazetteerRestEndpoint)
-
getNerModelUrl
public URL getNerModelUrl()
-
setNerModelUrl
@Field public void setNerModelUrl(String nerModelUrl)
- Parameters:
nerModelUrl- url for the NER model- Throws:
IllegalArgumentException- for a malformed URL
-
-