001: package org.contineo.core.text.analyze;
002:
003: /**
004: * Created on 13.01.2005
005: */
006: public class Stopwords {
007: private final static String[] GERMAN_STOP_WORDS = { "der", "die",
008: "das", "dass", "daß", "ein", "dies", "dem", "den", "des",
009: "zu", "zum", "zur", "eine", "einer", "einem", "einen",
010: "eines", "auf", "aus", "am", "im", "in", "um", "an", "und",
011: "oder", "ohne", "mit", "ich", "du", "er", "sie", "es",
012: "wir", "ihr", "mein", "sein", "dein", "euer", "eure",
013: "mich", "dich", "sich", "durch", "wegen", "bei", "neben",
014: "vor", "nach", "von", "vom", "als", "für", "wird", "werde",
015: "werden", "werdet", "werd,", "wurde", "wurden", "wurdet",
016: "wurdest", "wurd", "würde", "würden", "würdet", "würdest",
017: "würd", "kann", "können", "konn", "muss", "muß", "müss",
018: "müßte", "müssen", "musste", "mußtet", "mußte", "müsste",
019: "wer", "wie", "was", "wem", "wen", "wessen", "wo", "womit",
020: "wofür", "wodurch", "wobei", "wonach", "welch", "welcher",
021: "welchen", "welches", "welchem", "nicht", "nur", "damit",
022: "so", "auch", "ist", "sind", "war", "waren", "man", "also",
023: "aber", "über", "soll", "will", "woll", "wollen", "wollt",
024: "wolltet", "willst", "wollte", "wolltest", "wollten",
025: "weil", "noch", "dabei", "dann", "danach", "ja", "nein",
026: "immer", "nie", "jetzt", "heute", "mehr", "weniger", "all",
027: "solch", "solcher", "solche", "solches", "solchen",
028: "solchem", "bereits", "zwischen", "innen", "aussen",
029: "außen", "innerhalb", "außerhalb", "wieder", "wider",
030: "gegen", "wenn", "hat", "hab", "je", "jed", "jede",
031: "jeder", "jedes", "jeden", "jedem", "gar", "dar",
032: "einzeln", "möglich", "haben", "hat", "hatte", "hast",
033: "hattest", "habt", "hattet", "hatten", "hätt", "hätte",
034: "hätten", "hättest", "hättet", "oben", "unten", "über",
035: "unter", "obere", "untere", "weiterhin", "desweiteren",
036: "gut", "schlecht", "allgemein", "wichtig", "etwas",
037: "anhand", "jedoch", "dazu", "dafür", "ers", "zwei", "drit",
038: "drei", "vier", "erster", "zweiter", "dritter", "vierter",
039: "beispiel", "beispielsweise", "bis", "neu", "neue",
040: "neues", "neuen", "neuer", "neuem", "andere", "anderes",
041: "anderen", "anderer", "anders", "anderem", "richtig",
042: "falsch", "sowie" };
043:
044: private final static String[] FRENCH_STOP_WORDS = { "alors", "au",
045: "aucuns", "aussi", "autre", "avant", "avec", "avoir",
046: "bon", "car", "ce", "cela", "ces", "ceux", "chaque", "ci",
047: "comme", "comment", "dans", "des", "du", "dedans",
048: "dehors", "depuis", "deux", "devrait", "doit", "donc",
049: "dos", "droite", "début", "elle", "elles", "en", "encore",
050: "essai", "est", "et", "eu", "fait", "faites", "fois",
051: "font", "force", "haut", "hors", "ici", "il", "ils", "je",
052: "juste", "la", "le", "les", "leur", "là", "ma",
053: "maintenant", "mais", "mes", "mine", "moins", "mon", "mot",
054: "même", "ni", "nommés", "notre", "nous", "nouveaux", "ou",
055: "où", "par", "parce", "parole", "pas", "personnes", "peut",
056: "peu", "pièce", "plupart", "pour", "pourquoi", "quand",
057: "que", "quel", "quelle", "quelles", "quels", "qui", "sa",
058: "sans", "ses", "seulement", "si", "sien", "son", "sont",
059: "sous", "soyez", "sujet", "sur", "ta", "tandis",
060: "tellement", "tels", "tes", "ton", "tous", "tout", "trop",
061: "très", "tu", "valeur", "voie", "voient", "vont", "votre",
062: "vous", "vu", "ça", "étaient", "état", "étions", "été",
063: "être" };
064:
065: private final static String[] ENGLISH_STOP_WORDS = { "a", "and",
066: "are", "as", "at", "be", "but", "by", "for", "if", "in",
067: "into", "is", "it", "no", "not", "of", "on", "or", "s",
068: "such", "too", "that", "the", "their", "then", "there",
069: "these", "they", "this", "to", "was", "will", "with",
070: "thus", "have", "has", "had", "do", "did", "yes", "than",
071: "those", "just", "like", "about", "which", "who", "what",
072: "whom", "when", "where", "within", "without", "whose",
073: "although", "all", "because", "while", "how", "here",
074: "any", "some", "during", "next", "previous", "does",
075: "between", "been", "one", "two", "three", "four", "five",
076: "six", "seven", "eight", "nine", "ten", "bottom", "top",
077: "down", "up", "left", "right", "whether", "whole", "also",
078: "now", "onto", "still", "often", "more", "most", "good",
079: "best", "go", "better", "gone", "went", "many", "much",
080: "lot", "sever" };
081: private final static String[] SPANISH_STOP_WORDS = { "un", "una",
082: "unas", "unos", "uno", "sobre", "todo", "también", "tras",
083: "otro", "algún", "alguno", "alguna",
084:
085: "algunos", "algunas", "ser", "es", "soy", "eres", "somos",
086: "sois", "estoy", "esta", "estamos", "estais",
087:
088: "estan", "en", "para", "atras", "porque", "por qué",
089: "estado", "estaba", "ante", "antes", "siendo",
090:
091: "ambos", "pero", "por", "poder", "puede", "puedo",
092: "podemos", "podeis", "pueden", "fui", "fue", "fuimos",
093:
094: "fueron", "hacer", "hago", "hace", "hacemos", "haceis",
095: "hacen", "cada", "fin", "incluso", "primero",
096:
097: "desde", "conseguir", "consigo", "consigue", "consigues",
098: "conseguimos", "consiguen", "ir", "voy", "va",
099:
100: "vamos", "vais", "van", "vaya", "bueno", "ha", "tener",
101: "tengo", "tiene", "tenemos", "teneis", "tienen",
102:
103: "el", "la", "lo", "las", "los", "su", "aqui", "mio",
104: "tuyo", "ellos", "ellas", "nos", "nosotros", "vosotros",
105:
106: "vosotras", "si", "dentro", "solo", "solamente", "saber",
107: "sabes", "sabe", "sabemos", "sabeis", "saben",
108:
109: "ultimo", "largo", "bastante", "haces", "muchos",
110: "aquellos", "aquellas", "sus", "entonces", "tiempo",
111:
112: "verdad", "verdadero", "verdadera", "cierto", "ciertos",
113: "cierta", "ciertas", "intentar", "intento",
114:
115: "intenta", "intentas", "intentamos", "intentais",
116: "intentan", "dos", "bajo", "arriba", "encima", "usar",
117:
118: "uso", "usas", "usa", "usamos", "usais", "usan", "emplear",
119: "empleo", "empleas", "emplean", "ampleamos",
120:
121: "empleais", "valor", "muy", "era", "eras", "eramos",
122: "eran", "modo", "bien", "cual", "cuando", "donde",
123:
124: "mientras", "quien", "con", "entre", "sin", "trabajo",
125: "trabajar", "trabajas", "trabaja", "trabajamos",
126:
127: "trabajais", "trabajan", "podria", "podrias", "podriamos",
128: "podrian", "podriais", "yo", "aquel", "mi",
129:
130: "de", "a", "e", "i", "o", "u", "y" };
131:
132: /**
133: * A list of Italian stop words taken from
134: * <code><a href="http://www.snowball.tartarus.org/algorithms/italian/stop.txt">http://www.snowball.tartarus.org/algorithms/italian/stop.txt</a></code>
135: */
136: private final static String[] ITALIAN_STOP_WORDS = { "a", "abbia",
137: "abbiamo", "abbiano", "abbiate", "ad", "agl", "agli", "ai",
138: "al", "all", "alla", "alle", "allo", "anche", "avemmo",
139: "avendo", "avesse", "avessero", "avessi", "avessimo",
140: "aveste", "avesti", "avete", "aveva", "avevamo", "avevano",
141: "avevate", "avevi", "avevo", "avrà", "avrai", "avranno",
142: "avrebbe", "avrebbero", "avrei", "avremmo", "avremo",
143: "avreste", "avresti", "avrete", "avrò", "avuta", "avute",
144: "avuti", "avuto", "c", "che", "chi", "ci", "coi", "come",
145: "con", "contro", "cui", "da", "dagl", "dagli", "dai",
146: "dal", "dall", "dalle", "dallo", "degl", "degli", "dei",
147: "del", "dell", "della", "delle", "dello", "di", "dov",
148: "dove", "e", "è", "ebbe", "ebbero", "ebbi", "ed", "erano",
149: "eravamo", "eravate", "eri", "ero", "essendo", "fa", "fà",
150: "facciamo", "facciano", "faccio", "facemmo", "facendo",
151: "facesse", "facessero", "facessi", "facessimo", "faceste",
152: "facesti", "faceva", "facevamo", "facevano", "facevate",
153: "facevi", "facevo", "fai", "fanno", "farà", "farai",
154: "faranno", "farebbe", "farebbero", "farei", "faremmo",
155: "faremo", "fareste", "faresti", "farete", "farò", "fece",
156: "fecero", "fossero", "fossimo", "foste", "fosti", "fu",
157: "fui", "fummo", "furono", "gli", "ha", "hai", "hanno",
158: "ho", "i", "il", "in", "io", "l", "la", "là", "le", "lei",
159: "li", "lì", "lo", "loro", "lui", "ma", "mi", "mia", "mie",
160: "miei", "mio", "ne", "negl", "negli", "nei", "nel", "nell",
161: "nella", "nelle", "nello", "noi", "non", "nostra",
162: "nostre", "nostri", "nostro", "o", "per", "perché", "più",
163: "quale", "quanta", "quante", "quanti", "quanto", "quella",
164: "quelle", "quelli", "quello", "questa", "queste", "questi",
165: "questo", "sarà", "sarai", "saranno", "sarebbe",
166: "sarebbero", "sarei", "saremmo", "saremo", "sareste",
167: "saresti", "sarete", "sarò", "se", "sei", "si", "sì",
168: "sia", "siamo", "siano", "siate", "siete", "sono", "sta",
169: "stai", "stando", "stanno", "starà", "starai", "staranno",
170: "starebbe", "starebbero", "starei", "staremmo", "staremo",
171: "stareste", "staresti", "starete", "starò", "stava",
172: "stavamo", "stavano", "stavate", "stavi", "stavo",
173: "stemmo", "stesse", "stessero", "stessi", "stessimo",
174: "steste", "stesti", "stette", "stettero", "stetti", "stia",
175: "stiamo", "stiano", "stiate", "sto", "su", "sua", "sue",
176: "sugl", "sugli", "sui", "sul", "sull", "sulla", "sulle",
177: "sullo", "suo", "suoi", "ti", "tra", "tu", "tua", "tue",
178: "tuo", "tuoi", "tutti", "tutto", "un", "una", "uno", "vi",
179: "voi", "vostra", "vostre", "vostri", "vostro" };
180:
181: public static String[] getStopwords(String language) {
182: if (language.equalsIgnoreCase("de")) {
183: return GERMAN_STOP_WORDS;
184: } else if (language.equalsIgnoreCase("fr")) {
185: return FRENCH_STOP_WORDS;
186: } else if (language.equalsIgnoreCase("es")) {
187: return SPANISH_STOP_WORDS;
188: } else if (language.equalsIgnoreCase("it")) {
189: return ITALIAN_STOP_WORDS;
190: } else {
191: return ENGLISH_STOP_WORDS;
192: }
193: }
194: }
|