Package dk.brics.automaton

Examples of dk.brics.automaton.RegExp


public class CompiledAutomaton implements RegexImpl {

    private RunAutomaton runauto = null;
   
    public CompiledAutomaton( String rhsPattern ) {
        RegExp regexpr = new dk.brics.automaton.RegExp(rhsPattern);
        Automaton auto = regexpr.toAutomaton();
        this.runauto = new RunAutomaton(auto, true);
    }
View Full Code Here


        s_anyChar=BasicAutomata.makeAnyChar();
        s_anyString=BasicAutomata.makeAnyString();
        s_anyStringWithNonemptyLangTag=s_anyString.concatenate(s_nonemptyLangTag);
    }
    protected static Automaton languageTagAutomaton() {
        return new RegExp(
            "("+
                "([a-zA-Z]{2,3}"+
                    "("+
                        "(-[a-zA-Z]{3}){0,3}"+             // extlang
                    ")?"+
View Full Code Here

            "(-([a-wy-zA-WY-Z0-9](-[a-zA-Z0-9]{2,8})+))*"+       // extension
            "(-x(-[a-zA-Z0-9]{1,8})+)?"                    // privateuse
        ).toAutomaton();
    }
    protected static Automaton normalizedStringAutomaton() {
        return new RegExp("([\u0020-\u007F\u00A0-\uD7FF\uE000-\uFFFD])*").toAutomaton();
    }
View Full Code Here

    }
    protected static Automaton normalizedStringAutomaton() {
        return new RegExp("([\u0020-\u007F\u00A0-\uD7FF\uE000-\uFFFD])*").toAutomaton();
    }
    protected static Automaton tokenAutomaton() {
        return new RegExp("([\u0021-\uD7FF\uE000-\uFFFD]+(\u0020[\u0021-\uD7FF\uE000-\uFFFD]+)*)?").toAutomaton();
    }
View Full Code Here

            stringPart=s_anyString.intersection(BasicOperations.repeat(s_anyChar,minLength,maxLength));
        return stringPart.concatenate(s_anyLangTag);
    }
    public static boolean isValidPattern(String pattern) {
        try {
            new RegExp(pattern);
            return true;
        }
        catch (IllegalArgumentException e) {
            return false;
        }
View Full Code Here

        catch (IllegalArgumentException e) {
            return false;
        }
    }
    public static Automaton getPatternAutomaton(String pattern) {
        Automaton stringPart=new RegExp(pattern).toAutomaton();
        return stringPart.concatenate(s_anyLangTag);
    }
View Full Code Here

        else
            return s_anyString.intersection(BasicOperations.repeat(s_anyChar,minLength,maxLength));
    }
    public static boolean isValidPattern(String pattern) {
        try {
            new RegExp(pattern);
            return true;
        }
        catch (IllegalArgumentException e) {
            return false;
        }
View Full Code Here

        catch (IllegalArgumentException e) {
            return false;
        }
    }
    public static Automaton getPatternAutomaton(String pattern) {
        return new RegExp(pattern).toAutomaton();
    }
View Full Code Here

            sb.append(Integer.toString(getNumberForOntId(custType)));
          }
          sb.append("))?");
        }
        //System.out.println(sb.toString());
        Automaton subAut = new RegExp(sb.toString()).toAutomaton();
        //System.out.println(subAut.isDeterministic());
        //mainAut = mainAut.union(subAut);
        List<Automaton> autList = autLists.get(type);
        if(autList == null) {
          autList = new ArrayList<Automaton>();
View Full Code Here

   
    private RunAutomaton automaton;
   
    Rule(boolean sign, String regex) {
      super(sign, regex);
      automaton = new RunAutomaton(new RegExp(regex, RegExp.ALL).toAutomaton());
    }
View Full Code Here

TOP

Related Classes of dk.brics.automaton.RegExp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.