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

gov.nih.nlm.nls.lvg.Flows.ToLowerCase Maven / Gradle / Ivy

The newest version!
package gov.nih.nlm.nls.lvg.Flows;
import java.util.*;
import gov.nih.nlm.nls.lvg.Lib.*;
/*****************************************************************************
* This class lowercases the input term.
*
* 

History: *

    *
* * @author NLM NLS Development Team * * @see * Design Document * * @version V-2010 ****************************************************************************/ public class ToLowerCase extends Transformation implements Cloneable { // public methods /** * Performs the mutation of this flow component. * * @param in a LexItem as the input for this flow component * @param detailsFlag a boolean flag for processing details information * @param mutateFlag a boolean flag for processing mutate information * * @return Vector the results from this flow component */ public static Vector Mutate(LexItem in, boolean detailsFlag, boolean mutateFlag) { // mutate the term String term = in.GetSourceTerm().toLowerCase(); // details & mutate String details = null; String mutate = null; if(detailsFlag == true) { details = INFO; } if(mutateFlag == true) { mutate = Transformation.NO_MUTATE_INFO; } // update target LexItem Vector out = new Vector(); LexItem temp = UpdateLexItem(in, term, Flow.LOWER_CASE, Transformation.UPDATE, Transformation.UPDATE, details, mutate); out.addElement(temp); return out; } /** * A unit test driver for this flow component. */ public static void main(String[] args) { String testStr = GetTestStr(args, "AIDS"); // get input String // Mutate LexItem in = new LexItem(testStr); Vector outs = ToLowerCase.Mutate(in, true, true); PrintResults(in, outs); // print out results } // private method // data members private static final String INFO = "Lowercase Words"; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy