package com.dbxml.db.common.fulltext;

/*
 * dbXML - Native XML Database
 * Copyright (C) 1999-2004  The dbXML Group, L.L.C.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * $Id: WordStemmer.java,v 1.2 2004/02/12 00:17:56 bradford Exp $
 */

/**
 * WordStemmer is an interface for defining stemmers.  Stemmers are typically
 * used for western languages that support the concept of prefix, suffix, and
 * tense.  By default, dbXML uses a Porter Stemmer, which is specifically for
 * the English language, but it should be fairly trivial to develop a Stemmer
 * for non-English languages.
 */

public interface WordStemmer {
   /**
    * normalizeCase normalizes the case of the specific word.  Case
    * normalization is language-specific, as is stemming, so it made
    * sense to tie the two functions into one interface.  By default
    * dbXML normalizes to lower-case.
    *
    * @param word The word to normalize
    * @return The normalized word
    */
   String normalizeCase(String word);

   /**
    * stemWord stems the specified word.
    *
    * @param word The word to stem
    * @return The stemmed word
    */
   String stemWord(String word);
}
