public void processNode(INode node) throws ContextPreprocessorException {
        try {
            // reset old preprocessing
            node.getNodeData().setcLabFormula("");
            node.getNodeData().setcNodeFormula("");
            while (0 < node.getNodeData().getACoLCount()) {
                node.getNodeData().removeACoL(0);
            }

            boolean isEmpty = true;
            String labelOfNode = node.getNodeData().getName().trim();

            if (debugLabels) {
                log.debug("preprocessing: " + labelOfNode);
            }

            labelOfNode = labelOfNode.toLowerCase();
            List<ISense> wnSense = new ArrayList<ISense>();
            if (!(("top".equals(labelOfNode) || "thing".equals(labelOfNode)) && !node.hasParent()) && (!meaninglessWords.contains(labelOfNode + " ")) && (isTokenMeaningful(labelOfNode))) {
                wnSense = linguisticOracle.getSenses(labelOfNode);
            }
            if ((0 == wnSense.size()) && !(("top".equals(labelOfNode) || "thing".equals(labelOfNode)) && !node.hasParent()) && (!meaninglessWords.contains(labelOfNode + " ")) && (isTokenMeaningful(labelOfNode))) {
                labelOfNode = replacePunctuation(labelOfNode);
                wnSense = linguisticOracle.getSenses(labelOfNode);
            }

            // identifiers of meaningful tokens in
            String meaningfulTokens = " ";
            // tokens of the label of node
            List<String> tokensOfNodeLabel = new ArrayList<String>();

            // is the label a WordNet entry?
            int id_tok = 0;
            if (0 < wnSense.size()) {
                // add to list of processed labels
                tokensOfNodeLabel.add(labelOfNode);
                List<String> lemmas = linguisticOracle.getBaseForms(labelOfNode);
                String lemma = labelOfNode;
                if (0 < lemmas.size()) {
                    lemma = lemmas.get(0);
                }

                // create atomic node of label
                IAtomicConceptOfLabel ACoL = createACoL(node, id_tok, labelOfNode, lemma);
                // to token ids
                meaningfulTokens = meaningfulTokens + id_tok + " ";
                // add senses to ACoL
                for (ISense sense : wnSense) {
                    ACoL.addSense(sense);
                }
                isEmpty = false;
                id_tok++;
            } else {
                // The label of node is not in WN
                // Split the label by words
                StringTokenizer lemmaTokenizer = new StringTokenizer(labelOfNode, " _()[]/'\\#1234567890");
                ArrayList<String> tokens = new ArrayList<String>();
                while (lemmaTokenizer.hasMoreElements()) {
                    tokens.add(lemmaTokenizer.nextToken());
                }

                // perform multiword recognition
                tokens = multiwordRecognition(tokens);
                // for all tokens in label
                for (int i = 0; i < tokens.size(); i++) {
                    String token = tokens.get(i).trim();
                    // if the token is not meaningless
                    if ((!meaninglessWords.contains(token + " ")) && (isTokenMeaningful(token))) {
                        // add to list of processed tokens
                        tokensOfNodeLabel.add(token);
                        // if not logical connective
                        if ((!andWords.contains(token)) && ((orWords.indexOf(token)) == -1)
                                && ((notWords.indexOf(token)) == -1) && (!isNumber(token))) {
                            // get WN senses for token
                            if (!(("top".equals(token) || "thing".equals(token)) && !node.hasParent())) {
                                wnSense = linguisticOracle.getSenses(token);
                            } else {
                                wnSense = new ArrayList<ISense>();
                            }
                            if (0 == wnSense.size()) {
                                List<String> newTokens = complexWordsRecognition(token);
                                if (0 < newTokens.size()) {
                                    tokensOfNodeLabel.remove(tokensOfNodeLabel.size() - 1);
                                    tokensOfNodeLabel.add(newTokens.get(0));
                                    wnSense = linguisticOracle.getSenses(newTokens.get(0));
                                    tokens.remove(i);
                                    tokens.add(i, newTokens.get(0));
                                    for (int j = 1; j < newTokens.size(); j++) {
                                        String s = newTokens.get(j);
                                        tokens.add(i + j, s);
                                    }
                                }
                            }
                            List<String> lemmas = linguisticOracle.getBaseForms(token);
                            String lemma = token;
                            if (0 < lemmas.size()) {
                                lemma = lemmas.get(0);
                            }

                            // create atomic node of label
                            IAtomicConceptOfLabel ACoL = createACoL(node, id_tok, token, lemma);
                            // mark id as meaningful
                            meaningfulTokens = meaningfulTokens + id_tok + " ";
                            // if there no WN senses
                            if (0 == wnSense.size() && !(("top".equals(labelOfNode) || "thing".equals(labelOfNode)) && !node.hasParent())) {
                                unrecognizedWords.add(token);
                            }
                            // add senses to ACoL
                            for (ISense sense : wnSense) {
                                ACoL.addSense(sense);
                            }
                            isEmpty = false;
                        }
                        id_tok++;
                    }
                }
            }

            if (isEmpty) {
                String token = labelOfNode.replaceAll(" ", "_");
                // add to list of processed labels
                tokensOfNodeLabel.add(token);
                // create atomic node of label
                createACoL(node, id_tok, token, token);
                // to token ids
                meaningfulTokens = meaningfulTokens + id_tok + " ";
            }
            // build complex formula of a node
            buildComplexConcept(node, tokensOfNodeLabel, meaningfulTokens);
            node.getNodeData().setIsPreprocessed(true);
        } catch (LinguisticOracleException e) {
            final String errMessage = e.getClass().getSimpleName() + ": " + e.getMessage();
            log.error(errMessage, e);
            throw new ContextPreprocessorException(errMessage, e);
        }
    }
public void processNode ( INode node ) throws ContextPreprocessorException { try { node . getNodeData ( ) . setcLabFormula ( "" ) ; node . getNodeData ( ) . setcNodeFormula ( "" ) ; while ( 0 < node . getNodeData ( ) . getACoLCount ( ) ) { node . getNodeData ( ) . removeACoL ( 0 ) ; } boolean isEmpty = true ; String labelOfNode = node . getNodeData ( ) . getName ( ) . trim ( ) ; if ( debugLabels ) { log . debug ( "preprocessing: " + labelOfNode ) ; } labelOfNode = labelOfNode . toLowerCase ( ) ; List < ISense > wnSense = new ArrayList < ISense > ( ) ; if ( ! ( ( "top" . equals ( labelOfNode ) || "thing" . equals ( labelOfNode ) ) && ! node . hasParent ( ) ) && ( ! meaninglessWords . contains ( labelOfNode + " " ) ) && ( isTokenMeaningful ( labelOfNode ) ) ) { wnSense = linguisticOracle . getSenses ( labelOfNode ) ; } if ( ( 0 == wnSense . size ( ) ) && ! ( ( "top" . equals ( labelOfNode ) || "thing" . equals ( labelOfNode ) ) && ! node . hasParent ( ) ) && ( ! meaninglessWords . contains ( labelOfNode + " " ) ) && ( isTokenMeaningful ( labelOfNode ) ) ) { labelOfNode = replacePunctuation ( labelOfNode ) ; wnSense = linguisticOracle . getSenses ( labelOfNode ) ; } String meaningfulTokens = " " ; List < String > tokensOfNodeLabel = new ArrayList < String > ( ) ; int id_tok = 0 ; if ( 0 < wnSense . size ( ) ) { tokensOfNodeLabel . add ( labelOfNode ) ; List < String > lemmas = linguisticOracle . getBaseForms ( labelOfNode ) ; String lemma = labelOfNode ; if ( 0 < lemmas . size ( ) ) { lemma = lemmas . get ( 0 ) ; } IAtomicConceptOfLabel ACoL = createACoL ( node , id_tok , labelOfNode , lemma ) ; meaningfulTokens = meaningfulTokens + id_tok + " " ; for ( ISense sense : wnSense ) { ACoL . addSense ( sense ) ; } isEmpty = false ; id_tok ++ ; } else { StringTokenizer lemmaTokenizer = new StringTokenizer ( labelOfNode , " _()[]/'\\#1234567890" ) ; ArrayList < String > tokens = new ArrayList < String > ( ) ; while ( lemmaTokenizer . hasMoreElements ( ) ) { tokens . add ( lemmaTokenizer . nextToken ( ) ) ; } tokens = multiwordRecognition ( tokens ) ; for ( int i = 0 ; i < tokens . size ( ) ; i ++ ) { String token = tokens . get ( i ) . trim ( ) ; if ( ( ! meaninglessWords . contains ( token + " " ) ) && ( isTokenMeaningful ( token ) ) ) { tokensOfNodeLabel . add ( token ) ; if ( ( ! andWords . contains ( token ) ) && ( ( orWords . indexOf ( token ) ) == - 1 ) && ( ( notWords . indexOf ( token ) ) == - 1 ) && ( ! isNumber ( token ) ) ) { if ( ! ( ( "top" . equals ( token ) || "thing" . equals ( token ) ) && ! node . hasParent ( ) ) ) { wnSense = linguisticOracle . getSenses ( token ) ; } else { wnSense = new ArrayList < ISense > ( ) ; } if ( 0 == wnSense . size ( ) ) { List < String > newTokens = complexWordsRecognition ( token ) ; if ( 0 < newTokens . size ( ) ) { tokensOfNodeLabel . remove ( tokensOfNodeLabel . size ( ) - 1 ) ; tokensOfNodeLabel . add ( newTokens . get ( 0 ) ) ; wnSense = linguisticOracle . getSenses ( newTokens . get ( 0 ) ) ; tokens . remove ( i ) ; tokens . add ( i , newTokens . get ( 0 ) ) ; for ( int j = 1 ; j < newTokens . size ( ) ; j ++ ) { String s = newTokens . get ( j ) ; tokens . add ( i + j , s ) ; } } } List < String > lemmas = linguisticOracle . getBaseForms ( token ) ; String lemma = token ; if ( 0 < lemmas . size ( ) ) { lemma = lemmas . get ( 0 ) ; } IAtomicConceptOfLabel ACoL = createACoL ( node , id_tok , token , lemma ) ; meaningfulTokens = meaningfulTokens + id_tok + " " ; if ( 0 == wnSense . size ( ) && ! ( ( "top" . equals ( labelOfNode ) || "thing" . equals ( labelOfNode ) ) && ! node . hasParent ( ) ) ) { unrecognizedWords . add ( token ) ; } for ( ISense sense : wnSense ) { ACoL . addSense ( sense ) ; } isEmpty = false ; } id_tok ++ ; } } } if ( isEmpty ) { String token = labelOfNode . replaceAll ( " " , "_" ) ; tokensOfNodeLabel . add ( token ) ; createACoL ( node , id_tok , token , token ) ; meaningfulTokens = meaningfulTokens + id_tok + " " ; } buildComplexConcept ( node , tokensOfNodeLabel , meaningfulTokens ) ; node . getNodeData ( ) . setIsPreprocessed ( true ) ; } catch ( LinguisticOracleException e ) { final String errMessage = e . getClass ( ) . getSimpleName ( ) + ": " + e . getMessage ( ) ; log . error ( errMessage , e ) ; throw new ContextPreprocessorException ( errMessage , e ) ; } }
Creates concept of a label formula.

@param node node to process
@throws ContextPreprocessorException ContextPreprocessorException