adding morph classes for language
git-svn-id: https://russianmorphology.googlecode.com/svn/trunk@64 d817d54c-26ab-11de-abc9-2f7d1455ff7a
This commit is contained in:
@ -22,7 +22,6 @@ import org.apache.lucene.morphology.WrongCharaterException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
//todo extract supper class for common method with russian letter decoder
|
||||
public class EnglishLetterDecoderEncoder implements LetterDecoderEncoder {
|
||||
public static final int ENGLISH_SMALL_LETTER_OFFSET = 96;
|
||||
static public int SUFFIX_LENGTH = 6;
|
||||
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2009 Alexander Kuznetsov
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.lucene.morphology.english;
|
||||
|
||||
import org.apache.lucene.morphology.LuceneMorphology;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class EnglishLuceneMorphology extends LuceneMorphology {
|
||||
|
||||
public EnglishLuceneMorphology() throws IOException {
|
||||
super(EnglishLuceneMorphology.class.getResourceAsStream("/org/apache/lucene/morphology/english/morph.info"), new EnglishLetterDecoderEncoder());
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright 2009 Alexander Kuznetsov
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.lucene.morphology.english;
|
||||
|
||||
import org.apache.lucene.morphology.Morphology;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
public class EnglishMorphology extends Morphology {
|
||||
|
||||
public EnglishMorphology() throws IOException {
|
||||
super(EnglishLuceneMorphology.class.getResourceAsStream("/org/apache/lucene/morphology/english/morph.info"), new EnglishLetterDecoderEncoder());
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.apache.lucene.morphology.english;
|
||||
|
||||
import org.apache.lucene.morphology.LuceneMorph;
|
||||
import org.apache.lucene.morphology.LuceneMorphology;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import org.junit.Before;
|
||||
@ -29,11 +29,11 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class EnglishLuceneMorphTest {
|
||||
private LuceneMorph luceneMorph;
|
||||
private LuceneMorphology luceneMorph;
|
||||
|
||||
@Before
|
||||
public void setUp() throws IOException {
|
||||
luceneMorph = new LuceneMorph(this.getClass().getResourceAsStream("/org/apache/lucene/morphology/english/morph.info"), new EnglishLetterDecoderEncoder());
|
||||
luceneMorph = new LuceneMorphology(this.getClass().getResourceAsStream("/org/apache/lucene/morphology/english/morph.info"), new EnglishLetterDecoderEncoder());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user