Here you can find the source of areEqualLexemes(String l1, String l2)
Parameter | Description |
---|---|
l1 | a parameter |
l2 | a parameter |
private static boolean areEqualLexemes(String l1, String l2)
//package com.java2s; /******************************************************************************* * Copyright 2012/*w w w. j av a 2 s . c om*/ * Ubiquitous Knowledge Processing (UKP) Lab * Technische Universit?t Darmstadt * * 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. *******************************************************************************/ public class Main { /** * Sometimes different API methods deliver different results, e.g. we can find a synset for a lexeme with underscores with one method, but not with the other. * Thus, equal lexemes should be tested a little bit more thoroughly. * * @param l1 * @param l2 * @return */ private static boolean areEqualLexemes(String l1, String l2) { if (l1.equals(l2)) { return true; } // replace spaces with underscores. String l1_relaxed = l1.replaceAll(" ", "_"); String l2_relaxed = l2.replaceAll(" ", "_"); if (l1_relaxed.equals(l2_relaxed)) { return true; } return false; } }