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

gov.nih.nlm.nls.lvg.Util.Char Maven / Gradle / Ivy

The newest version!
package gov.nih.nlm.nls.lvg.Util;
/*****************************************************************************
* This class represents character related methods.
*
* 

History: * * @author NLM NLS Development Team * * @version V-2010 ****************************************************************************/ public class Char { // public methods /** * Check if a char is a puntuation. Punctuations include: *

  • DASH_PUNCTUATION: - *
  • START_PUNCTUATION: ( { [ *
  • END_PUNCTUATION: ) } ] *
  • CONNECTOR_PUNCTUATION: _ *
  • OTHER_PUNCTUATION: !@#%&*\:;"',.?/ *
  • MATH_SYMBOL: ~ + = | < > *
  • CURRENCY_SYMBOL: $ *
  • MODIFIER_SYMBOL: ` ^ * * @param inChar input chararter for checking if it is a punctuation * * @return true or false if the input character is or is not a punctuation */ public static boolean IsPunctuation(char inChar) { boolean isPunctuation = false; int type = Character.getType(inChar); // check if the input is a punctuation if((type == Character.DASH_PUNCTUATION) // - || (type == Character.START_PUNCTUATION) // ( { [ || (type == Character.END_PUNCTUATION) // ) } ] || (type == Character.CONNECTOR_PUNCTUATION) // _ || (type == Character.OTHER_PUNCTUATION) // !@#%&*\:;"',.?/ || (type == Character.MATH_SYMBOL) // ~ + = | < > || (type == Character.CURRENCY_SYMBOL) // $ || (type == Character.MODIFIER_SYMBOL)) // ` ^ { isPunctuation = true; } return isPunctuation; } }




  • © 2015 - 2025 Weber Informatics LLC | Privacy Policy