Skip to content

Commit

Permalink
Updated repository for openspaces and fixed deprecated stuff for Lucene.
Browse files Browse the repository at this point in the history
Closes jottinger#5.
Closes jottinger#6.
  • Loading branch information
jottinger committed Aug 12, 2011
1 parent 1a6a639 commit 38e966c
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 15 deletions.
1 change: 1 addition & 0 deletions ci-bayes/pom.xml
Expand Up @@ -17,6 +17,7 @@
<url>https://ci-bayes.dev.java.net</url>
<properties>
<springVersion>3.0.5.RELEASE</springVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<licenses>
<license>
Expand Down
Expand Up @@ -9,6 +9,8 @@
import org.apache.lucene.analysis.snowball.SnowballFilter;
import org.apache.lucene.analysis.standard.StandardTokenizer;
import org.apache.lucene.util.Version;
import org.apache.lucene.analysis.tokenattributes.TermAttribute;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;

import com.google.common.collect.Sets;

Expand All @@ -33,18 +35,14 @@ public void addWords(Object obj, Collection<String> features) {
StandardTokenizer tokenizer = new StandardTokenizer(Version.LUCENE_30,new StringReader(document));
tokenizer.setMaxTokenLength(20);
SnowballFilter psf = new SnowballFilter(tokenizer, "English");
Token t;
StringBuilder sb = new StringBuilder();
OffsetAttribute offsetAttribute = tokenizer.getAttribute(OffsetAttribute.class);
TermAttribute termAttribute = tokenizer.getAttribute(TermAttribute.class);
try {
while ((t = psf.next()) != null) {
sb.setLength(0);
sb.append(t.termBuffer(), 0, t.termLength());
//System.out.println(sb.toString());
features.add(sb.toString());
while(tokenizer.incrementToken()) {
features.add(termAttribute.term());
}
} catch (IOException e) {
// should never happen! We're reading a flippin' STRING!
e.printStackTrace();
} catch(IOException e) {
throw new Error("IOException where no IOException should be", e);
}
}
}
6 changes: 4 additions & 2 deletions db4o-dao/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.0.1</version>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -73,7 +73,9 @@
<repositories>
<repository>
<id>db4o</id>
<url>https://source.db4o.com/maven</url>
<name>db4o maven repository</name>
<url>http://source.db4o.com/maven/</url>
<layout>default</layout>
</repository>
</repositories>
</project>
2 changes: 1 addition & 1 deletion gigaspaces-dao/pom.xml
Expand Up @@ -95,7 +95,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.0.1</version>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion interfaces/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.0.1</version>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion jdbc-dao/pom.xml
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>[5.14,)</version>
<version>6.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
3 changes: 3 additions & 0 deletions model/pom.xml
Expand Up @@ -12,6 +12,9 @@
<artifactId>model</artifactId>
<version>3.0.2</version>
<name>model</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.enigmastation.ci-bayes.dao</groupId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Expand Up @@ -66,6 +66,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down

0 comments on commit 38e966c

Please sign in to comment.