GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — UsingTheApi UsingTheApi
Yann Barraud edited this page
The first thing you need is a populated Configuration object (all classes mentioned here are in the Before starting the processor you need to register a MatchListener so that the processor will inform you when it finds matches. The easiest way to implement one is to subclass Now you're ready. To find duplicates, call There's more to the API, of course, but this is the basics. Here's a trivial example of a command-line client that loads the config file pointed to on the command-line and prints match information to standard out. import no.priv.garshol.duke.*; import no.priv.garshol.duke.matchers.PrintMatchListener; public class RunDuke { public static void main(String[] argv) throws Exception { Configuration config = ConfigLoader.load(argv[1]); Processor proc = new Processor(config); proc.addMatchListener(new PrintMatchListener(true, true, true, false, config.getProperties(), true)); proc.deduplicate(); proc.close(); } } In the example above, Duke does all the work, reading from the data sources and processing the records. If you want, you can run the driving loop yourself. To do that, you need to build collections of Record objects. You can write your own implementation of the interface, or just use Note that in this case Duke doesn't clean the data, but simply processes them directly. So any cleaning will need to be done beforehand. The full javadoc is hosted off-site. To include Duke in your Maven project, see the MavenSetup page. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |