1

I would like to a offline package to determine the country a person lives in from a text field in a database named locatoin. I started using CLAVIN which gives good results sometimes but surprisingly dosn't work on easy results. For example:

  • "Toronto, Canada"
  • "Fremantle, WA"

Both fail to return a result. I have deliberately skipped out the GeoParsing steps as I already know the text is an location. I am using the LuceneLocationResolver class, for example initialise the object:

LuceneLocationResolver locRes = new LuceneLocationResolver(file, 1, 10);

Create a location occurrence instance:

LocationOccurrence LocationOccurrence_instance = new LocationOccurrence("Toronto, Canada",0);

Add it to a list and try and resolve the location:

List<ResolvedLocation> result = locRes.resolveLocations(locations, false);

Am I using CLAVIN in the right way or is it just not up to scratch?

Backgroud: my main applicatoin is in Python but couldn't find anything that would do the job. So i'm using JPype to interact with CLAVIN using Python.

1

Sorry for the late response. CLAVIN would prefer to treat "Toronto, Canada" as two separate locations. So, you should try creating two LocationOccurrence instances:

LocationOccurrence LocationOccurrence_A = new LocationOccurrence("Toronto",0);
LocationOccurrence LocationOccurrence_B = new LocationOccurrence("Canada",9);

I hope that helps. Good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.