pt.tumba.geoclass
Class CommonSites

java.lang.Object
  extended by pt.tumba.geoclass.CommonSites

public final class CommonSites
extends java.lang.Object

CommonSites is a simple URL to geographic scope lookup table, using regular expressions to match URL paths.

Author:
Bruno Martins
See Also:
Map

Constructor Summary
CommonSites(java.lang.String dictionaryFileName)
          Constructor for CommonSites
CommonSites(java.lang.String dictionaryFileName, boolean compression)
          Constructor for CommonSites.
 
Method Summary
 void cleanup()
          Cleanup the lookup table.
 Node[] find(java.lang.String url)
          Search the lookup table and return the scope for a given URL.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonSites

public CommonSites(java.lang.String dictionaryFileName)
            throws java.lang.Exception
Constructor for CommonSites

Parameters:
dictionaryFileName - The File path leading up to the lookup dictionary.
Throws:
java.lang.Exception

CommonSites

public CommonSites(java.lang.String dictionaryFileName,
                   boolean compression)
            throws java.lang.Exception
Constructor for CommonSites.

Parameters:
dictionaryFileName - The File path leading up to the lookup dictionary.
compression - If true, the dictionary file is compressed with the GZIP algorithm, and if false, the file is a normal text document.
Throws:
java.lang.Exception
Method Detail

find

public Node[] find(java.lang.String url)
Search the lookup table and return the scope for a given URL.

Parameters:
url - An URL.
Returns:
An array with the list of possible scopes.

cleanup

public void cleanup()
Cleanup the lookup table.