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

org.unlaxer.jaddress.util.kuromoji.NumberOrAlphabetGrouping Maven / Gradle / Ivy

The newest version!
package org.unlaxer.jaddress.util.kuromoji;

import java.util.function.BiPredicate;

import com.atilika.kuromoji.ipadic.Token;

public class NumberOrAlphabetGrouping implements BiPredicate{
	
	public static final NumberOrAlphabetGrouping SINGLETON = new NumberOrAlphabetGrouping();

	@Override
	public boolean test(Token token1, Token token2) {
		String _1_partOfSpeechLevel1 = token1.getPartOfSpeechLevel1();
		String _1_partOfSpeechLevel2 = token1.getPartOfSpeechLevel2();
		
		String _2_partOfSpeechLevel1 = token2.getPartOfSpeechLevel1();
		String _2_partOfSpeechLevel2 = token2.getPartOfSpeechLevel2();
		
		return (_1_partOfSpeechLevel1.equals(_2_partOfSpeechLevel1) && 
				_1_partOfSpeechLevel2.equals(_2_partOfSpeechLevel2)) &&
				(_1_partOfSpeechLevel2.equals("数") || _1_partOfSpeechLevel2.equals("アルファベット"));
	}
	
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy