All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliasi.test.unit.tokenizer.EnglishStopTokenizerFactoryTest Maven / Gradle / Ivy

Go to download

This is the original Lingpipe: http://alias-i.com/lingpipe/web/download.html There were not made any changes to the source code.

There is a newer version: 4.1.2-JL1.0
Show newest version
package com.aliasi.test.unit.tokenizer;

import com.aliasi.tokenizer.EnglishStopTokenizerFactory;
import com.aliasi.tokenizer.IndoEuropeanTokenizerFactory;
import com.aliasi.tokenizer.TokenizerFactory;

import com.aliasi.util.AbstractExternalizable;

import java.io.IOException;
import java.io.NotSerializableException;

import org.junit.Test;
import static com.aliasi.test.unit.Asserts.assertNotSerializable;
import static com.aliasi.test.unit.tokenizer.TokenizerTest.assertFactory;

public class EnglishStopTokenizerFactoryTest {

    @Test
    public void testFactory() {
        TokenizerFactory ieFactory  
            = IndoEuropeanTokenizerFactory.INSTANCE;
        TokenizerFactory factory
            = new EnglishStopTokenizerFactory(ieFactory);
        assertFactory(factory,
                      "");
        assertFactory(factory,
                      "a");
        assertFactory(factory,
                      "the a");
        assertFactory(factory,
                      "the foo a",
                      "foo");
        assertFactory(factory,
                      "foo bar a the baz",
                      "foo","bar","baz");
    }

    @Test
    public void testNotSerializable() {
        EnglishStopTokenizerFactory unserializable
            = new EnglishStopTokenizerFactory(TokenizerTest
                                              .UNSERIALIZABLE_FACTORY);
        assertNotSerializable(unserializable);
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy