简体   繁体   中英

Weka Snowball Stemmer giving errors

I have a program like this -

import weka.core.stemmers.SnowballStemmer;

public class TestProject{
public static void main(String[] args) {    
   String testString = "shortly";
      SnowballStemmer stem = new SnowballStemmer();   
      String text = stem.stem(testString);
      System.out.println(text);
   }
}

This program executes and I get the following output -

---Registering Weka Editors---
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in    CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?

shortli

My question is how to remove those 5 lines of errors that are printed when the program executes?

I am not using any database.

Thank You,

Not sure if this is the right thing to do because if adding snowball.jar initialize the database connection, probably snowball need that connection for a reason. But anyway, here is a workaround if you want that five lines of errors not to be printed.

  • make a copy of DatabaseUtils.props, you can find it from weka.jar /weka/experiement/DatabaseUtils.props
  • place this properties file in your classpath. For example in eclipse, place it at the root of the project.
  • commented out all lines start with jdbcDriver.
  • added a line jdbcDriver=

When I execute the class file with the properties file in place, this is the output.

---Registering Weka Editors---
shortli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM