Package net.fortytwo.ripple.model

Examples of net.fortytwo.ripple.model.Lexicon


    private void updateCompletors() {
        logger.fine("updating completors");
        List<Completer> completors = new ArrayList<Completer>();

        try {
            Lexicon lex = queryEngine.getLexicon();

            synchronized (lex) {
                completors.add(lex.getCompletor());
            }

            ArrayList<String> directives = new ArrayList<String>();
            directives.add("@help");
            directives.add("@list");
View Full Code Here


    private void updateCompletors() {
        logger.debug("updating completors");
        List<Completor> completors = new ArrayList<Completor>();

        try {
            Lexicon lex = queryEngine.getLexicon();

            synchronized (lex) {
                completors.add(lex.getCompletor());
            }

            ArrayList<String> directives = new ArrayList<String>();
            directives.add("@count");
            directives.add("@define");
View Full Code Here

                       final StackEvaluator evaluator,
                       final PrintStream out,
                       final PrintStream err) throws RippleException {
        this.model = model;
        this.evaluator = evaluator;
        lexicon = new Lexicon(model);
        printStream = new RipplePrintStream(out, lexicon);
        errorPrintStream = err;

        connection = model.createConnection(new LexiconUpdater(lexicon));
View Full Code Here

        String[] validPrefixes = {"", "a", "a_", "a-", "foo-bar", "rdf", "ns108"};
        String[] inValidPrefixes = {"_a", "-a", "a b", "5", "107a", "a.b"};
        String[] validLocalNames = {"", "a", "foo", "foo1331", "_a", "__a"};
        String[] inValidLocalNames = {".a", "a.b", "23", "2a"};

        Lexicon l = new Lexicon(getTestModel());

        for (String prefix : validPrefixes) {
            assertTrue("\"" + prefix + "\" should be accepted as a valid prefix", l.isValidPrefix(prefix));
        }

        for (String prefix : inValidPrefixes) {
            assertFalse("\"" + prefix + "\" should not be accepted as a valid prefix", l.isValidPrefix(prefix));
        }
    }
View Full Code Here

    public void testisValidLocalName() throws Exception {
        // TODO: make this into a more thorough collection of test cases
        String[] validLocalNames = {"", "a", "foo", "foo1331", "_a", "__a"};
        String[] inValidLocalNames = {".a", "a.b", "23", "2a"};

        Lexicon l = new Lexicon(getTestModel());

        for (String localName : validLocalNames) {
            assertTrue("\"" + localName + "\" should be accepted as a valid local name",
                    l.isValidLocalName(localName));
        }

        for (String localName : inValidLocalNames) {
            assertFalse("\"" + localName + "\" should not be accepted as a valid local name",
                    l.isValidLocalName(localName));
        }
    }
View Full Code Here

TOP

Related Classes of net.fortytwo.ripple.model.Lexicon

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.