datapreparation.stopword
Class NorwegianStopwords

java.lang.Object
  extended by datapreparation.stopword.NorwegianStopwords
All Implemented Interfaces:
Stopwords

public class NorwegianStopwords
extends java.lang.Object
implements Stopwords

A class that eliminates Norwegian stopwords from a document.

Author:
Kjell-Inge Skogstad and Trond Řivind Eriksen

Constructor Summary
NorwegianStopwords()
          A constructor that loads the English stopwords file, and puts the words in a HashMap
 
Method Summary
 java.lang.String getNorDefaultName()
          A method that gets the textfile with English stopwords.
 boolean loadNor(java.lang.String filename)
          A method that loads a file of the most common English words, and puts them in the HashMap
 boolean loadNorFromURL(java.lang.String filename)
          A method that loads a file of the most common English words from an URL, and puts them in the HashMap
 java.lang.String removeStopwords(java.lang.String sentence)
          A method that removes Norwegian stopwords from a sentence.
 java.lang.String stringCat(java.lang.String string1, java.lang.String string2)
          A method that concatenates two strings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NorwegianStopwords

public NorwegianStopwords()
A constructor that loads the English stopwords file, and puts the words in a HashMap

Method Detail

getNorDefaultName

public java.lang.String getNorDefaultName()
A method that gets the textfile with English stopwords.

Returns:
The textfile with English stopwords.

loadNor

public boolean loadNor(java.lang.String filename)
A method that loads a file of the most common English words, and puts them in the HashMap

Parameters:
filename - the filename of the most common words in English
Returns:
Return true if load is ok, false otherwise

loadNorFromURL

public boolean loadNorFromURL(java.lang.String filename)
A method that loads a file of the most common English words from an URL, and puts them in the HashMap

Parameters:
filename - the filename of the most common words in English
Returns:
Return true if load is ok, false otherwise

stringCat

public java.lang.String stringCat(java.lang.String string1,
                                  java.lang.String string2)
A method that concatenates two strings.

Parameters:
string1 - The first string to be concatenated
string2 - The second string to be concatenated
Returns:
The concatenated string (string1+string2)

removeStopwords

public java.lang.String removeStopwords(java.lang.String sentence)
A method that removes Norwegian stopwords from a sentence.

Specified by:
removeStopwords in interface Stopwords
Parameters:
sentence - The string
Returns:
The sentence, not containing any stopwords