コード例 #1
0
  private ExpressionNode parseFreeText() throws ParseExpressionException {
    Set<String> ids = miOntologyTree.getIdByName(scanner.getCurrSymbol());

    ExpressionNode rootNode = null;

    if (ids.size() > 0) {
      Object[] idsArr = ids.toArray();
      String tmpExpression = (String) idsArr[0];

      for (int i = 1; i < idsArr.length; ++i) {
        tmpExpression = tmpExpression + " or " + (String) idsArr[i];
      }

      ExpressionTree tmpTree = new ExpressionTree(tmpExpression, miOntologyTree, false);

      rootNode = tmpTree.getRootNode();

    } else {
      // TODO FIXME if I give a tag that doesn't have an MI identifier, we return all services.
      // TODO collect these non matching terms and print a warning message on the resulting HTML
      // page.
      rootNode = new ExpressionTrueNode();
    }

    return rootNode;
  }