$ANTLR start "NE"
350302
public final void mNE() throws RecognitionException {
		try {
			int _type = NE;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:738:3: ( '!=' | '^=' )
			int alt1=2;
			int LA1_0 = input.LA(1);
			if ( (LA1_0=='!') ) {
				alt1=1;
			}
			else if ( (LA1_0=='^') ) {
				alt1=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 1, 0, input);
				throw nvae;
			}

			switch (alt1) {
				case 1 :
					// hql.g:738:5: '!='
					{
					match("!="); if (state.failed) return;

					}
					break;
				case 2 :
					// hql.g:738:12: '^='
					{
					match("^="); if (state.failed) return;

					}
					break;

			}
			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
737535
public final AntlrDatatypeRuleToken ruleOpUnary() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token kw=null;


        	enterRule();

        try {
            // InternalPureXbase.g:2089:2: ( (kw= '!' | kw= '-' | kw= '+' ) )
            // InternalPureXbase.g:2090:2: (kw= '!' | kw= '-' | kw= '+' )
            {
            // InternalPureXbase.g:2090:2: (kw= '!' | kw= '-' | kw= '+' )
            int alt37=3;
            switch ( input.LA(1) ) {
            case 50:
                {
                alt37=1;
                }
                break;
            case 45:
                {
                alt37=2;
                }
                break;
            case 44:
                {
                alt37=3;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return current;}
                NoViableAltException nvae =
                    new NoViableAltException("", 37, 0, input);

                throw nvae;
            }

            switch (alt37) {
                case 1 :
                    // InternalPureXbase.g:2091:3: kw= '!'
                    {
                    kw=(Token)match(input,50,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpUnaryAccess().getExclamationMarkKeyword_0());
                      		
                    }

                    }
                    break;
                case 2 :
                    // InternalPureXbase.g:2097:3: kw= '-'
                    {
                    kw=(Token)match(input,45,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpUnaryAccess().getHyphenMinusKeyword_1());
                      		
                    }

                    }
                    break;
                case 3 :
                    // InternalPureXbase.g:2103:3: kw= '+'
                    {
                    kw=(Token)match(input,44,FOLLOW_2); if (state.failed) return current;
                    if ( state.backtracking==0 ) {

                      			current.merge(kw);
                      			newLeafNode(kw, grammarAccess.getOpUnaryAccess().getPlusSignKeyword_2());
                      		
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
1193866
public final void mTABLE() throws RecognitionException {
		try {
			int _type = TABLE;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:595:17: ( ( 'TABLE' | 'table' ) )
			// druidG.g:595:18: ( 'TABLE' | 'table' )
			{
			// druidG.g:595:18: ( 'TABLE' | 'table' )
			int alt11=2;
			int LA11_0 = input.LA(1);
			if ( (LA11_0=='T') ) {
				alt11=1;
			}
			else if ( (LA11_0=='t') ) {
				alt11=2;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 11, 0, input);
				throw nvae;
			}

			switch (alt11) {
				case 1 :
					// druidG.g:595:19: 'TABLE'
					{
					match("TABLE"); 

					}
					break;
				case 2 :
					// druidG.g:595:27: 'table'
					{
					match("table"); 

					}
					break;

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
847176
def p_expr_NE_expr(p):
    
    p[0] = make_binary(p.lineno(2), 'NE', p[1], p[3], lambda x, y: x != y)
303053
public final AntlrDatatypeRuleToken ruleOpExponent() throws RecognitionException {
        AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken();

        Token kw=null;


        	enterRule();

        try {
            // InternalSARL.g:8964:2: (kw= '**' )
            // InternalSARL.g:8965:2: kw= '**'
            {
            kw=(Token)match(input,72,FOLLOW_2); if (state.failed) return current;
            if ( state.backtracking==0 ) {

              		current.merge(kw);
              		newLeafNode(kw, grammarAccess.getOpExponentAccess().getAsteriskAsteriskKeyword());
              	
            }

            }

            if ( state.backtracking==0 ) {

              	leaveRule();

            }
        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
337323
public final void ruleEnumLiterals() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXtext.g:1433:2: ( ( ( rule__EnumLiterals__Group__0 ) ) )
            // InternalXtext.g:1434:2: ( ( rule__EnumLiterals__Group__0 ) )
            {
            // InternalXtext.g:1434:2: ( ( rule__EnumLiterals__Group__0 ) )
            // InternalXtext.g:1435:3: ( rule__EnumLiterals__Group__0 )
            {
             before(grammarAccess.getEnumLiteralsAccess().getGroup()); 
            // InternalXtext.g:1436:3: ( rule__EnumLiterals__Group__0 )
            // InternalXtext.g:1436:4: rule__EnumLiterals__Group__0
            {
            pushFollow(FollowSets000.FOLLOW_2);
            rule__EnumLiterals__Group__0();

            state._fsp--;


            }

             after(grammarAccess.getEnumLiteralsAccess().getGroup()); 

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
132979
public static void convertNonCanonicalStrings(final List<Token> sentence,
      final String lang) {
    // System.err.println((int)'’');
    for (final Token token : sentence) {
      token.setTokenValue(
          apostrophe.matcher(token.getTokenValue()).replaceAll("'"));
      token.setTokenValue(
          ellipsis.matcher(token.getTokenValue()).replaceAll(THREE_DOTS));
      token.setTokenValue(
          longDash.matcher(token.getTokenValue()).replaceAll("--"));
      if (lang.equalsIgnoreCase("en")) {
        token.setTokenValue(
            oneFourth.matcher(token.getTokenValue()).replaceAll("1\\\\/4"));
        token.setTokenValue(
            oneThird.matcher(token.getTokenValue()).replaceAll("1\\\\/3"));
        token.setTokenValue(
            oneHalf.matcher(token.getTokenValue()).replaceAll("1\\\\/2"));
        token.setTokenValue(
            threeQuarters.matcher(token.getTokenValue()).replaceAll("3\\\\/4"));
        token.setTokenValue(
            sterling.matcher(token.getTokenValue()).replaceAll("#"));
      }
      token.setTokenValue(
          oneFourth.matcher(token.getTokenValue()).replaceAll("1/4"));
      token.setTokenValue(
          oneThird.matcher(token.getTokenValue()).replaceAll("1/3"));
      token.setTokenValue(
          oneHalf.matcher(token.getTokenValue()).replaceAll("1/2"));
      token.setTokenValue(
          twoThirds.matcher(token.getTokenValue()).replaceAll("2/3"));
      token.setTokenValue(
          threeQuarters.matcher(token.getTokenValue()).replaceAll("3/4"));
      token.setTokenValue(
          cents.matcher(token.getTokenValue()).replaceAll("cents"));
    }
  }
156328
public static void main(String[] args) throws Exception {
		
		NERTagger tag = new NERTagger("../models/seg.m","../models/pos.m");
		String str = " 新浪体育讯　北京时间4月15日03:00(英国当地时间14日20:00)，2009/10赛季英格兰足球超级联赛第34轮一场焦点战在白鹿巷球场展开角逐，阿森纳客场1比2不敌托特纳姆热刺，丹尼-罗斯和拜尔先入两球，本特纳扳回一城。阿森纳仍落后切尔西6分(净胜球少15个)，夺冠几成泡影。热刺近 7轮联赛取得6胜，继续以1分之差紧逼曼城。";
		HashMap<String, String> map = new HashMap<String, String>();
		tag.tag(str,map);
		System.out.println(map);
		map = tag.tagFile("../example-data/data-tag.txt");
		System.out.println(map);
		System.out.println("Done!");
	}
371863
public final void mINNER() throws RecognitionException {
		try {
			int _type = INNER;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:35:7: ( 'inner' )
			// hql.g:35:9: 'inner'
			{
			match("inner"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
630610
public final void mCONTAINS() throws RecognitionException {
		try {
			int _type = CONTAINS;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:621:9: ( ( 'CONTAINS' ) )
			// druidG.g:621:11: ( 'CONTAINS' )
			{
			// druidG.g:621:11: ( 'CONTAINS' )
			// druidG.g:621:12: 'CONTAINS'
			{
			match("CONTAINS"); 

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
272457
public final void mPIPE() throws RecognitionException {
		try {
			int _type = PIPE;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:291:5: ( '|' )
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:291:7: '|'
			{
			match('|'); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
53371
public final void mEscapeSequence() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:126:5: ( '\\\\' ( 'b' | 'B' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' | '.' | 'o' | 'x' | 'a' | 'e' | 'c' | 'd' | 'D' | 's' | 'S' | 'w' | 'W' | 'p' | 'A' | 'G' | 'Z' | 'z' | 'Q' | 'E' | '*' | '[' | ']' | '(' | ')' | '$' | '^' | '{' | '}' | '?' | '+' | '-' | '&' | '|' ) | UnicodeEscape | OctalEscape )
			int alt54=3;
			int LA54_0 = input.LA(1);
			if ( (LA54_0=='\\') ) {
				switch ( input.LA(2) ) {
				case '\"':
				case '$':
				case '&':
				case '\'':
				case '(':
				case ')':
				case '*':
				case '+':
				case '-':
				case '.':
				case '?':
				case 'A':
				case 'B':
				case 'D':
				case 'E':
				case 'G':
				case 'Q':
				case 'S':
				case 'W':
				case 'Z':
				case '[':
				case '\\':
				case ']':
				case '^':
				case 'a':
				case 'b':
				case 'c':
				case 'd':
				case 'e':
				case 'f':
				case 'n':
				case 'o':
				case 'p':
				case 'r':
				case 's':
				case 't':
				case 'w':
				case 'x':
				case 'z':
				case '{':
				case '|':
				case '}':
					{
					alt54=1;
					}
					break;
				case 'u':
					{
					alt54=2;
					}
					break;
				case '0':
				case '1':
				case '2':
				case '3':
				case '4':
				case '5':
				case '6':
				case '7':
					{
					alt54=3;
					}
					break;
				default:
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 54, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 54, 0, input);
				throw nvae;
			}

			switch (alt54) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:126:9: '\\\\' ( 'b' | 'B' | 't' | 'n' | 'f' | 'r' | '\\\"' | '\\'' | '\\\\' | '.' | 'o' | 'x' | 'a' | 'e' | 'c' | 'd' | 'D' | 's' | 'S' | 'w' | 'W' | 'p' | 'A' | 'G' | 'Z' | 'z' | 'Q' | 'E' | '*' | '[' | ']' | '(' | ')' | '$' | '^' | '{' | '}' | '?' | '+' | '-' | '&' | '|' )
					{
					match('\\'); if (state.failed) return;
					if ( input.LA(1)=='\"'||input.LA(1)=='$'||(input.LA(1) >= '&' && input.LA(1) <= '+')||(input.LA(1) >= '-' && input.LA(1) <= '.')||input.LA(1)=='?'||(input.LA(1) >= 'A' && input.LA(1) <= 'B')||(input.LA(1) >= 'D' && input.LA(1) <= 'E')||input.LA(1)=='G'||input.LA(1)=='Q'||input.LA(1)=='S'||input.LA(1)=='W'||(input.LA(1) >= 'Z' && input.LA(1) <= '^')||(input.LA(1) >= 'a' && input.LA(1) <= 'f')||(input.LA(1) >= 'n' && input.LA(1) <= 'p')||(input.LA(1) >= 'r' && input.LA(1) <= 't')||(input.LA(1) >= 'w' && input.LA(1) <= 'x')||(input.LA(1) >= 'z' && input.LA(1) <= '}') ) {
						input.consume();
						state.failed=false;
					}
					else {
						if (state.backtracking>0) {state.failed=true; return;}
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:130:9: UnicodeEscape
					{
					mUnicodeEscape(); if (state.failed) return;

					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:131:9: OctalEscape
					{
					mOctalEscape(); if (state.failed) return;

					}
					break;

			}
		}
		finally {
			// do for sure before leaving
		}
	}
1019748
public final void arguments() throws RecognitionException {
		Token LEFT_PAREN26=null;
		Token RIGHT_PAREN27=null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:718:5: ( LEFT_PAREN ( expressionList )? RIGHT_PAREN )
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:718:7: LEFT_PAREN ( expressionList )? RIGHT_PAREN
			{
			LEFT_PAREN26=(Token)match(input,LEFT_PAREN,FOLLOW_LEFT_PAREN_in_arguments4500); if (state.failed) return;
			if ( state.backtracking==0 ) { helper.emit(LEFT_PAREN26, DroolsEditorType.SYMBOL); }
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:719:9: ( expressionList )?
			int alt95=2;
			int LA95_0 = input.LA(1);
			if ( (LA95_0==BOOL||(LA95_0 >= DECIMAL && LA95_0 <= DIV)||LA95_0==DOT||LA95_0==FLOAT||LA95_0==HEX||(LA95_0 >= ID && LA95_0 <= INCR)||(LA95_0 >= LEFT_PAREN && LA95_0 <= LESS)||LA95_0==MINUS||LA95_0==NEGATION||LA95_0==NULL||LA95_0==PLUS||LA95_0==QUESTION_DIV||(LA95_0 >= STAR && LA95_0 <= TIME_INTERVAL)) ) {
				alt95=1;
			}
			switch (alt95) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:719:9: expressionList
					{
					pushFollow(FOLLOW_expressionList_in_arguments4512);
					expressionList();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}

			RIGHT_PAREN27=(Token)match(input,RIGHT_PAREN,FOLLOW_RIGHT_PAREN_in_arguments4523); if (state.failed) return;
			if ( state.backtracking==0 ) { helper.emit(RIGHT_PAREN27, DroolsEditorType.SYMBOL); }
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
1175863
public final void mJavaLetterOrDigit() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1388:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '$' | '_' ) |{...}?~ ( '\\u0000' .. '\\u007F' | '\\uD800' .. '\\uDBFF' ) |{...}? ( '\\uD800' .. '\\uDBFF' ) ( '\\uDC00' .. '\\uDFFF' ) )
			int alt28=3;
			int LA28_0 = input.LA(1);
			if ( (LA28_0=='$'||(LA28_0 >= '0' && LA28_0 <= '9')||(LA28_0 >= 'A' && LA28_0 <= 'Z')||LA28_0=='_'||(LA28_0 >= 'a' && LA28_0 <= 'z')) ) {
				alt28=1;
			}
			else if ( ((LA28_0 >= '\u0080' && LA28_0 <= '\uD7FF')||(LA28_0 >= '\uDC00' && LA28_0 <= '\uFFFF')) ) {
				alt28=2;
			}
			else if ( ((LA28_0 >= '\uD800' && LA28_0 <= '\uDBFF')) ) {
				alt28=3;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 28, 0, input);
				throw nvae;
			}

			switch (alt28) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1388:4: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '$' | '_' )
					{
					if ( input.LA(1)=='$'||(input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||input.LA(1)=='_'||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
						input.consume();
					}
					else {
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1389:9: {...}?~ ( '\\u0000' .. '\\u007F' | '\\uD800' .. '\\uDBFF' )
					{
					if ( !((Character.isJavaIdentifierPart(input.LA(1)))) ) {
						throw new FailedPredicateException(input, "JavaLetterOrDigit", "Character.isJavaIdentifierPart(input.LA(1))");
					}
					if ( (input.LA(1) >= '\u0080' && input.LA(1) <= '\uD7FF')||(input.LA(1) >= '\uDC00' && input.LA(1) <= '\uFFFF') ) {
						input.consume();
					}
					else {
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1391:9: {...}? ( '\\uD800' .. '\\uDBFF' ) ( '\\uDC00' .. '\\uDFFF' )
					{
					if ( !((Character.isJavaIdentifierPart(Character.toCodePoint((char)input.LA(-1), (char)input.LA(1))))) ) {
						throw new FailedPredicateException(input, "JavaLetterOrDigit", "Character.isJavaIdentifierPart(Character.toCodePoint((char)input.LA(-1), (char)input.LA(1)))");
					}
					if ( (input.LA(1) >= '\uD800' && input.LA(1) <= '\uDBFF') ) {
						input.consume();
					}
					else {
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					if ( (input.LA(1) >= '\uDC00' && input.LA(1) <= '\uDFFF') ) {
						input.consume();
					}
					else {
						MismatchedSetException mse = new MismatchedSetException(null,input);
						recover(mse);
						throw mse;
					}
					}
					break;

			}
		}
		finally {
			// do for sure before leaving
		}
	}
437212
public final void mNEWLINE() throws RecognitionException {
		try {
			// druidG.g:716:20: ( ( '\\r\\n' | '\\r' | '\\n' ) )
			// druidG.g:716:23: ( '\\r\\n' | '\\r' | '\\n' )
			{
			// druidG.g:716:23: ( '\\r\\n' | '\\r' | '\\n' )
			int alt40=3;
			int LA40_0 = input.LA(1);
			if ( (LA40_0=='\r') ) {
				int LA40_1 = input.LA(2);
				if ( (LA40_1=='\n') ) {
					alt40=1;
				}

				else {
					alt40=2;
				}

			}
			else if ( (LA40_0=='\n') ) {
				alt40=3;
			}

			else {
				NoViableAltException nvae =
					new NoViableAltException("", 40, 0, input);
				throw nvae;
			}

			switch (alt40) {
				case 1 :
					// druidG.g:716:25: '\\r\\n'
					{
					match("\r\n"); 

					}
					break;
				case 2 :
					// druidG.g:717:18: '\\r'
					{
					match('\r'); 
					}
					break;
				case 3 :
					// druidG.g:718:18: '\\n'
					{
					match('\n'); 
					}
					break;

			}

			}

		}
		finally {
			// do for sure before leaving
		}
	}
681877
public final void mTHEN() throws RecognitionException {
		try {
			int _type = THEN;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:64:6: ( 'then' )
			// hql.g:64:8: 'then'
			{
			match("then"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
1113918
public final void mLESS() throws RecognitionException {
		try {
			int _type = LESS;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:230:5: ( '<' )
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:230:7: '<'
			{
			match('<'); if (state.failed) return;
			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}