StripDiacritics.java :  » Search » dspace-semantic-search » org » dspace » text » filter » Java Open Source

Java Open Source » Search » dspace semantic search 
dspace semantic search » org » dspace » text » filter » StripDiacritics.java
/**
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 * http://www.dspace.org/license/
 */
package org.dspace.text.filter;

/**
 * Strips decomposed diacritic characters from the supplied string
 * 
 * @author Graham Triggs
 *
 */
public class StripDiacritics implements TextFilter
{
    public String filter(String str)
    {
        return str.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
    }

    public String filter(String str, String lang)
    {
        return str.replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.