Examples of Lexicon


Examples of net.fortytwo.ripple.model.Lexicon

    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");

Examples of net.fortytwo.ripple.model.Lexicon

                       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));

Examples of net.fortytwo.ripple.model.Lexicon

        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));
        }
    }

Examples of net.fortytwo.ripple.model.Lexicon

    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));
        }
    }

Examples of net.sourceforge.chaperon.model.lexicon.Lexicon

    // Create a lexicon model for a given lexicon file
    LexiconFactory lexiconfactory = new LexiconFactory();
    xmlparser.setContentHandler(lexiconfactory);
    xmlparser.parse(lexiconFile.toString());

    Lexicon lexicon = lexiconfactory.getLexicon();

    // Build a automaton from the lexicon model
    LexicalAutomaton lexicalautomaton =
      (new LexicalAutomatonBuilder(lexicon, log)).getLexicalAutomaton();

Examples of net.sourceforge.chaperon.model.lexicon.Lexicon

  public void runTest() throws Throwable
  {
    System.out.println("======================= "+name+" =======================");

    Lexicon lexicon = getLexicon(step);

    LexicalProcessor processor = getLexicalProcessor(lexicon);

    Document result = process(processor, step);
    Document expected = getResult(step);

Examples of net.sourceforge.chaperon.model.lexicon.Lexicon

                                                  "' not found");
                }
                SourceUtil.toSAX(this.manager, this.lexiconSource, null, confighandler);

                Configuration config = confighandler.getConfiguration();
                Lexicon lexicon = LexiconFactory.createLexicon(config);

                LexicalAutomatonBuilder builder = new LexicalAutomatonBuilder(lexicon,
                                                      this.logger);

                this.automaton = builder.getLexicalAutomaton();

Examples of net.sourceforge.chaperon.model.lexicon.Lexicon

          throw new ProcessingException("Source '"+this.lexiconSource.getURI()+"' not found");

        LexiconFactory factory = new LexiconFactory();
        SourceUtil.toSAX(this.manager, this.lexiconSource, null, factory);

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        this.automaton = builder.getLexicalAutomaton();

Examples of net.sourceforge.chaperon.model.lexicon.Lexicon

          throw new ProcessingException("Source '"+this.lexiconSource.getURI()+"' not found");

        LexiconFactory factory = new LexiconFactory();
        SourceUtil.toSAX(this.manager, this.lexiconSource, null, factory);

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        this.automaton = builder.getLexicalAutomaton();

Examples of net.sourceforge.chaperon.model.lexicon.Lexicon

          throw new ProcessingException("Source '"+this.lexiconSource.getURI()+"' not found");

        LexiconFactory factory = new LexiconFactory();
        SourceUtil.toSAX(this.manager, this.lexiconSource, null, factory);

        Lexicon lexicon = factory.getLexicon();

        LexicalAutomatonBuilder builder =
          new LexicalAutomatonBuilder(lexicon/*, new AvalonLogger(this.logger)*/);

        LexicalAutomaton automaton = builder.getLexicalAutomaton();
TOP
Copyright © 2018 www.massapi.com. 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.