Java tutorial
//package com.java2s; /******************************************************************************* * Copyright (c) 2010, 2012 Institute for Dutch Lexicology * * 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 { /** * String used to separate the field/property name (say, contents_lemma) and the alternative * (e.g. "s" for case-sensitive) */ static String ALT_SEP; /** * Does this Lucene field name refer to a diacritics-sensitive alternative? * * Diacritics-sensitive alternatives are "s" (case- and diacritics-sensitive) * and "ci" (case-insensitive but diacritics-sensitive). * * @param fieldPropAltName Lucene field name including property and alt name * @return true if the field name refers to a diacritics-sensitive alternative */ public static boolean isDiacriticsSensitive(String fieldPropAltName) { // both-sensitive or case-insensitive return fieldPropAltName.endsWith(ALT_SEP + "s") || fieldPropAltName.endsWith(ALT_SEP + "ci"); } }