test_class.file: display/renderbasic/src/test/java/org/openscience/cdk/renderer/generators/standard/AbbreviationLabelTest.java
test_class.identifier: AbbreviationLabelTest
test_case.body: @Test
      public void parseNumberOnly() {
          assertFalse(AbbreviationLabel.parse("1", new ArrayList<String>()));
      }
test_case.class_method_signature: AbbreviationLabelTest.parseNumberOnly()
test_case.full_signature: @Test public void parseNumberOnly()
test_case.identifier: parseNumberOnly
test_case.invocations: assertFalse parse
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void parseNumberOnly()
focal_class.declarator: MINUS_STRING = "\u2212"
focal_class.modifier: private static final
focal_class.original_string: private static final String MINUS_STRING = "\u2212";
focal_class.type: String
focal_class.var_name: MINUS_STRING
focal_class.declarator: PREFIX_LIST = new String[]{
              "n", "norm", "n-", "c", "cy", "cyc", "cyclo", "c-", "cy-", "cyc-", "i", "iso", "i-", "t", "tert", "t-", "s",
              "sec", "s-", "o", "ortho", "o-", "m", "meta", "m-", "p", "para", "p-", "1-", "2-", "3-", "4-", "5-", "6-",
              "7-", "8-", "9-"
      }
focal_class.modifier: private final static
focal_class.original_string: private final static String[] PREFIX_LIST = new String[]{
              "n", "norm", "n-", "c", "cy", "cyc", "cyclo", "c-", "cy-", "cyc-", "i", "iso", "i-", "t", "tert", "t-", "s",
              "sec", "s-", "o", "ortho", "o-", "m", "meta", "m-", "p", "para", "p-", "1-", "2-", "3-", "4-", "5-", "6-",
              "7-", "8-", "9-"
      };
focal_class.type: String[]
focal_class.var_name: PREFIX_LIST
focal_class.declarator: ITAL_PREFIX = new String[]{
              "n", "norm", "sec", "s", "tert", "t",
              "ortho", "o", "meta", "m", "para", "p"
      }
focal_class.modifier: private final static
focal_class.original_string: private final static String[] ITAL_PREFIX = new String[]{
              "n", "norm", "sec", "s", "tert", "t",
              "ortho", "o", "meta", "m", "para", "p"
      };
focal_class.type: String[]
focal_class.var_name: ITAL_PREFIX
focal_class.declarator: SYMBOL_LIST = new String[]{"acac", "Ace", "Acetyl", "Acyl", "Ad", "All", "Alloc", "Allyl", "Amyl", "AOC",
                                                               "BDMS", "Benzoyl", "Benzyl", "Bn", "BOC", "Boc", "BOM", "bpy", "Bromo", "Bs", "Bu", "But", "Butyl", "Bz", "Bzl",
                                                               "Car", "Cbz", "Chloro", "CoA", "Cy",
                                                               "dppf", "dppp", "dba", "D", "Dan", "Dansyl", "DEIPS", "DEM", "Dip", "Dmb", "DPA", "DTBMS",
                                                               "EE", "EOM", "Et", "Ethyl",
                                                               "Fluoro", "FMOC", "Fmoc", "Formyl",
                                                               "Heptyl", "Hexyl",
                                                               "Iodo", "IPDMS",
                                                               "Me", "MEM", "Mesityl", "Mesyl", "Methoxy", "Methyl", "MOM", "Ms",
                                                               "Nitro",
                                                               "Oct", "Octyl",
                                                               "PAB", "Pentyl", "Ph", "Phenyl", "Pivaloyl", "PMB", "Pro", "Propargyl", "Propyl", "Pv",
                                                               "R", "SEM",
                                                               "T", "TBS", "TBDMS", "Trt", "TBDPS", "TES", "Tf", "THP", "THPO", "TIPS", "TMS", "Tos", "Tol", "Tosyl", "Tr", "Troc",
                                                               "Vinyl", "Voc", "Z"}
focal_class.modifier: private final static
focal_class.original_string: private final static String[] SYMBOL_LIST = new String[]{"acac", "Ace", "Acetyl", "Acyl", "Ad", "All", "Alloc", "Allyl", "Amyl", "AOC",
                                                               "BDMS", "Benzoyl", "Benzyl", "Bn", "BOC", "Boc", "BOM", "bpy", "Bromo", "Bs", "Bu", "But", "Butyl", "Bz", "Bzl",
                                                               "Car", "Cbz", "Chloro", "CoA", "Cy",
                                                               "dppf", "dppp", "dba", "D", "Dan", "Dansyl", "DEIPS", "DEM", "Dip", "Dmb", "DPA", "DTBMS",
                                                               "EE", "EOM", "Et", "Ethyl",
                                                               "Fluoro", "FMOC", "Fmoc", "Formyl",
                                                               "Heptyl", "Hexyl",
                                                               "Iodo", "IPDMS",
                                                               "Me", "MEM", "Mesityl", "Mesyl", "Methoxy", "Methyl", "MOM", "Ms",
                                                               "Nitro",
                                                               "Oct", "Octyl",
                                                               "PAB", "Pentyl", "Ph", "Phenyl", "Pivaloyl", "PMB", "Pro", "Propargyl", "Propyl", "Pv",
                                                               "R", "SEM",
                                                               "T", "TBS", "TBDMS", "Trt", "TBDPS", "TES", "Tf", "THP", "THPO", "TIPS", "TMS", "Tos", "Tol", "Tosyl", "Tr", "Troc",
                                                               "Vinyl", "Voc", "Z"};
focal_class.type: String[]
focal_class.var_name: SYMBOL_LIST
focal_class.declarator: PREFIX_TRIE = new Trie()
focal_class.modifier: private static
focal_class.original_string: private static Trie PREFIX_TRIE = new Trie();
focal_class.type: Trie
focal_class.var_name: PREFIX_TRIE
focal_class.declarator: ITAL_PREFIX_TRIE = new Trie()
focal_class.modifier: private static
focal_class.original_string: private static Trie ITAL_PREFIX_TRIE = new Trie();
focal_class.type: Trie
focal_class.var_name: ITAL_PREFIX_TRIE
focal_class.declarator: SYMBOL_TRIE = new Trie()
focal_class.modifier: private static
focal_class.original_string: private static Trie SYMBOL_TRIE = new Trie();
focal_class.type: Trie
focal_class.var_name: SYMBOL_TRIE
focal_class.declarator: STYLE_NORMAL    = 0
focal_class.modifier: static
focal_class.original_string: static int STYLE_NORMAL    = 0;
focal_class.type: int
focal_class.var_name: STYLE_NORMAL
focal_class.declarator: STYLE_SUBSCRIPT = -1
focal_class.modifier: static
focal_class.original_string: static int STYLE_SUBSCRIPT = -1;
focal_class.type: int
focal_class.var_name: STYLE_SUBSCRIPT
focal_class.declarator: STYLE_SUPSCRIPT = +1
focal_class.modifier: static
focal_class.original_string: static int STYLE_SUPSCRIPT = +1;
focal_class.type: int
focal_class.var_name: STYLE_SUPSCRIPT
focal_class.declarator: STYLE_ITALIC    = 2
focal_class.modifier: static
focal_class.original_string: static int STYLE_ITALIC    = 2;
focal_class.type: int
focal_class.var_name: STYLE_ITALIC
focal_class.file: display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/AbbreviationLabel.java
focal_class.identifier: AbbreviationLabel
focal_class.class_method_signature: AbbreviationLabel.parse(String label, List<String> tokens)
focal_class.full_signature: static boolean parse(String label, List<String> tokens)
focal_class.identifier: parse
focal_class.modifiers: static
focal_class.parameters: (String label, List<String> tokens)
focal_class.return: boolean
focal_class.signature: boolean parse(String label, List<String> tokens)
focal_class.class_method_signature: AbbreviationLabel.failParse(String label, List<String> tokens)
focal_class.full_signature: private static boolean failParse(String label, List<String> tokens)
focal_class.identifier: failParse
focal_class.modifiers: private static
focal_class.parameters: (String label, List<String> tokens)
focal_class.return: boolean
focal_class.signature: boolean failParse(String label, List<String> tokens)
focal_class.class_method_signature: AbbreviationLabel.isNumber(String str)
focal_class.full_signature: private static boolean isNumber(String str)
focal_class.identifier: isNumber
focal_class.modifiers: private static
focal_class.parameters: (String str)
focal_class.return: boolean
focal_class.signature: boolean isNumber(String str)
focal_class.class_method_signature: AbbreviationLabel.reverse(List<String> tokens)
focal_class.full_signature: static void reverse(List<String> tokens)
focal_class.identifier: reverse
focal_class.modifiers: static
focal_class.parameters: (List<String> tokens)
focal_class.return: void
focal_class.signature: void reverse(List<String> tokens)
focal_class.class_method_signature: AbbreviationLabel.format(List<String> tokens)
focal_class.full_signature: static List<FormattedText> format(List<String> tokens)
focal_class.identifier: format
focal_class.modifiers: static
focal_class.parameters: (List<String> tokens)
focal_class.return: List<FormattedText>
focal_class.signature: List<FormattedText> format(List<String> tokens)
focal_class.class_method_signature: AbbreviationLabel.reduce(List<FormattedText> texts, int from, int to)
focal_class.full_signature: static void reduce(List<FormattedText> texts, int from, int to)
focal_class.identifier: reduce
focal_class.modifiers: static
focal_class.parameters: (List<FormattedText> texts, int from, int to)
focal_class.return: void
focal_class.signature: void reduce(List<FormattedText> texts, int from, int to)
focal_class.class_method_signature: AbbreviationLabel.isChargeToken(String token)
focal_class.full_signature: private static boolean isChargeToken(String token)
focal_class.identifier: isChargeToken
focal_class.modifiers: private static
focal_class.parameters: (String token)
focal_class.return: boolean
focal_class.signature: boolean isChargeToken(String token)
focal_class.class_method_signature: AbbreviationLabel.isDigit(char c)
focal_class.full_signature: private static boolean isDigit(char c)
focal_class.identifier: isDigit
focal_class.modifiers: private static
focal_class.parameters: (char c)
focal_class.return: boolean
focal_class.signature: boolean isDigit(char c)
focal_class.class_method_signature: AbbreviationLabel.norm(char c)
focal_class.full_signature: private static char norm(char c)
focal_class.identifier: norm
focal_class.modifiers: private static
focal_class.parameters: (char c)
focal_class.return: char
focal_class.signature: char norm(char c)
focal_class.class_method_signature: AbbreviationLabel.findPrefix(Trie trie, String string, int i, int best)
focal_class.full_signature: private static int findPrefix(Trie trie, String string, int i, int best)
focal_class.identifier: findPrefix
focal_class.modifiers: private static
focal_class.parameters: (Trie trie, String string, int i, int best)
focal_class.return: int
focal_class.signature: int findPrefix(Trie trie, String string, int i, int best)
focal_class.class_method_signature: AbbreviationLabel.insert(Trie trie, String str, int i)
focal_class.full_signature: private static Trie insert(Trie trie, String str, int i)
focal_class.identifier: insert
focal_class.modifiers: private static
focal_class.parameters: (Trie trie, String str, int i)
focal_class.return: Trie
focal_class.signature: Trie insert(Trie trie, String str, int i)
focal_method.body: static boolean parse(String label, List<String> tokens) {
  
          int i = 0;
          int len = label.length();
  
          while (i < len) {
  
              int st = i;
              int last;
  
              char c = label.charAt(i);
  
              // BRACKETS we treat as separate
              if (c == '(' || c == ')') {
                  tokens.add(Character.toString(c));
                  i++;
  
                  // digits following closing brackets
                  if (c == ')') {
                      st = i;
                      while (i < len && isDigit(c = label.charAt(i))) {
                          i++;
                      }
                      if (i > st)
                          tokens.add(label.substring(st, i));
                  }
  
                  continue;
              }
  
              // separators
              if (c == '/' || c == '·' || c == '.' || c == '•' || c == '=') {
                  tokens.add(Character.toString(c));
                  i++;
  
                  int beg = i;
                  while (i < label.length() && isDigit(label.charAt(i))) {
                      i++;
                  }
                  if (i > beg)
                      tokens.add(label.substring(beg, i));
                  continue;
              }
  
              // SYMBOL Tokens
              // optional prefix o- m- p- etc.
              if ((last = findPrefix(PREFIX_TRIE, label, i, -1)) > 0) {
                  i += (last - i);
              }
              final int symSt = i;
  
              // a valid symbol token
              if ((last = findPrefix(SYMBOL_TRIE, label, i, -1)) > 0) {
                  i += (last - i);
                  // an optional number suffix e.g. O2 F3 Ph3 etc.
                  while (i < len && isDigit(label.charAt(i))) {
                      i++;
                  }
              }
              // a charge token, only if it's after some other parts
              else if (i == st && st > 0) {
                  c = norm(label.charAt(i));
                  if (c == '-' || c == '+') {
                      i++;
                      while (i < len && isDigit(label.charAt(i))) {
                          i++;
                      }
                      // we expect charge at the end of the string.. if there is
                      // still more it's not good input
                      if (i < len) {
                          return failParse(label, tokens);
                      }
                  }
              }
  
              if (i == st || i == symSt) {
                  return failParse(label, tokens);
              }
  
              tokens.add(label.substring(st, i));
          }
  
          return true;
      }
focal_method.class_method_signature: AbbreviationLabel.parse(String label, List<String> tokens)
focal_method.full_signature: static boolean parse(String label, List<String> tokens)
focal_method.identifier: parse
focal_method.invocations: length charAt add toString isDigit charAt add substring add toString length isDigit charAt add substring findPrefix findPrefix isDigit charAt norm charAt isDigit charAt failParse failParse add substring
focal_method.modifiers: static
focal_method.parameters: (String label, List<String> tokens)
focal_method.return: boolean
focal_method.signature: boolean parse(String label, List<String> tokens)