Package pl.edu.amu.wmi.daut.base

Examples of pl.edu.amu.wmi.daut.base.NondeterministicAutomatonByThompsonApproach


     */
    public void testEscapeOperatorV() {

        EscapeOperator operator6 = new EscapeOperator('v');
        AutomatonSpecification automaton6 = operator6.createFixedAutomaton();
        NondeterministicAutomatonByThompsonApproach result6 =
                new NondeterministicAutomatonByThompsonApproach(automaton6);

        assertFalse(automaton6.isEmpty());
        assertTrue(result6.accepts("\13"));
        assertFalse(result6.accepts("\\1313"));
        assertFalse(result6.accepts("13"));
    }
View Full Code Here


     */
    public void testAlnumNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("alnum");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("a"));
        assertFalse(automaton.accepts("Z"));
        assertFalse(automaton.accepts("9"));
        assertFalse(automaton.accepts(""));
        assertTrue(automaton.accepts("]"));
        assertTrue(automaton.accepts("$"));
        assertTrue(automaton.accepts("@"));
        assertFalse(automaton.accepts("asdada"));
    }
View Full Code Here

     */
    public void testAlphaNegatedAsciiCharacter() {
       ArrayList<String> params = new ArrayList<String>();
        params.add("alpha");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("a"));
        assertFalse(automaton.accepts("Z"));
        assertTrue(automaton.accepts("]"));
        assertTrue(automaton.accepts("$"));
        assertTrue(automaton.accepts("5"));
        assertFalse(automaton.accepts("asdada"));
    }
View Full Code Here

     */
    public void testBlankNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("blank");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("\t"));
        assertTrue(automaton.accepts("a"));
        assertTrue(automaton.accepts("Z"));
        assertTrue(automaton.accepts("9"));
        assertFalse(automaton.accepts("asfasd"));
    }
View Full Code Here

     */
    public void testCntrlNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("cntrl");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("\u0000"));
        assertFalse(automaton.accepts("\u0001"));
        assertTrue(automaton.accepts("a"));
        assertTrue(automaton.accepts("Z"));
        assertTrue(automaton.accepts("9"));
        assertFalse(automaton.accepts("sadada"));
    }
View Full Code Here

     */
    public void testDigitNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("digit");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("0"));
        assertFalse(automaton.accepts("3"));
        assertFalse(automaton.accepts("4"));
        assertFalse(automaton.accepts("1"));
        assertFalse(automaton.accepts("9"));
        assertTrue(automaton.accepts("a"));
        assertTrue(automaton.accepts("Z"));
        assertTrue(automaton.accepts("$"));
        assertFalse(automaton.accepts("asdasd"));
    }
View Full Code Here

     */
    public void testGraphNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("graph");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("!"));
        assertFalse(automaton.accepts("~"));
        assertFalse(automaton.accepts("-"));
        assertTrue(automaton.accepts("a"));
        assertTrue(automaton.accepts("Z"));
        assertTrue(automaton.accepts("9"));
        assertFalse(automaton.accepts("asdasdg"));
    }
View Full Code Here

     */
    public void testLowerNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("lower");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("z"));
        assertFalse(automaton.accepts("a"));
        assertFalse(automaton.accepts("g"));
        assertTrue(automaton.accepts("A"));
        assertTrue(automaton.accepts("Z"));
        assertTrue(automaton.accepts("9"));
        assertFalse(automaton.accepts("ADdd"));
    }
View Full Code Here

     */
    public void testPrintNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("print");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts(" "));
        assertFalse(automaton.accepts("a"));
        assertFalse(automaton.accepts("!"));
        assertFalse(automaton.accepts("*"));
        assertFalse(automaton.accepts("$"));
        assertFalse(automaton.accepts("\""));
        assertFalse(automaton.accepts("("));
        assertFalse(automaton.accepts("0"));
        assertFalse(automaton.accepts("sdada"));
    }
View Full Code Here

     */
    public void testPunctNegatedAsciiCharacter() {
        ArrayList<String> params = new ArrayList<String>();
        params.add("punct");
        RegexpOperator spec = (new NegatedAsciiCharacterClass.Factory()).createOperator(params);
        NondeterministicAutomatonByThompsonApproach automaton =
            new NondeterministicAutomatonByThompsonApproach(spec.createAutomaton(
                new ArrayList<AutomatonSpecification>()));
        assertFalse(automaton.accepts("!"));
        assertFalse(automaton.accepts("/"));
        assertFalse(automaton.accepts("@"));
        assertFalse(automaton.accepts("["));
        assertTrue(automaton.accepts("9"));
        assertFalse(automaton.accepts("3rre"));
    }
View Full Code Here

TOP

Related Classes of pl.edu.amu.wmi.daut.base.NondeterministicAutomatonByThompsonApproach

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.