Package lupos.autocomplete.misc

Examples of lupos.autocomplete.misc.Item


            possibilitiesList.addAll(this.findExistingElements(
                hashmapKey, testWord, indexBeforeCurrentWord,
                this.readerLocal, this.parserLocal));
          //ansonsten nur testWord
          } else {
            possibilitiesList.add(new Item(testWord, caseSensitiv));
          }
        //TestException = PE
        } else if (testException.substring(0, 2).equals("PE")) {
          if (this.parseErrorWordPE(testException).equals("<EOF>")) {
            //Analog
            if (hashmapKey != null) {
              possibilitiesList.addAll(this.findExistingElements(
                  hashmapKey, testWord,
                  indexBeforeCurrentWord, this.readerLocal,
                  this.parserLocal));

            } else {
              possibilitiesList.add(new Item(testWord,
                  caseSensitiv));
            }
          }
        }
View Full Code Here


            possibilitiesList.addAll(this.findExistingElements(
                hashmapKey, testWord, indexBeforeCurrentWord,
                this.readerLocal, this.parserLocal));
          //ansonsten nur testWord
          } else {
            possibilitiesList.add(new Item(testWord, caseSensitiv));
          }
        //TestException = PE
        } else if (testException.substring(0, 2).equals("PE")) {
          mainError = this.parseErrorWordPE(exception);
          subError = this.parseErrorWordPE(testException);
          if (mainError.equals(subError) || subError.equals("<EOF>")) {
            //Analog
            if (hashmapKey != null) {
              possibilitiesList.addAll(this.findExistingElements(
                  hashmapKey, testWord,
                  indexBeforeCurrentWord, this.readerLocal,
                  this.parserLocal));

            } else {
              possibilitiesList.add(new Item(testWord,
                  caseSensitiv));
            }
          }
        }
      }
View Full Code Here

            possibilitiesList.addAll(this.findExistingElements(
                hashmapKey, testWord, indexBeforeCurrentWord,
                this.readerLocal, this.parserLocal));
          //ansonsten nur testWord
          } else {
            possibilitiesList.add(new Item(testWord, caseSensitiv));
          }
        //TestException = PE
        } else if (testException.substring(0, 2).equals("PE")) {
          mainError = this.parseErrorWordLE(exception);
          subError = this.parseErrorWordPE(testException);
          if (mainError.equals(subError) || subError.equals("<EOF>")) {
            //Analog
            if (hashmapKey != null) {
              possibilitiesList.addAll(this.findExistingElements(
                  hashmapKey, testWord,
                  indexBeforeCurrentWord, this.readerLocal,
                  this.parserLocal));

            } else {
              possibilitiesList.add(new Item(testWord,
                  caseSensitiv));
            }
          }
        }
      }
View Full Code Here

      String[] splittedToken;
      while ((token = p.getNextToken(content)) != null) {
        splittedToken = token.toString().split(" ");
        if (splittedToken[2].equals(description)
            && !(arrayList.contains(splittedToken[9]))) {
          arrayList.add(new Item(splittedToken[9], true));
        }
      }
    }
    return arrayList;
  }
View Full Code Here

    final String currentWord = this.getCurrentWord(textDocument, cursorPosition);
    final int cwLength = currentWord.length();
    final List<Item> returnList = new ArrayList<Item>();

    ArrayList<Item> possibilitiesList = null;
    Item element_i;
    //prueft das aktuelle Dokument bis zur (Text)cursorPosition auf Fehler
    final String exception = this.handleException(textDocument.substring(0, cursorPosition));

    if (exception.substring(0,2).equals("PE")) {
      possibilitiesList = this.testforTokensPE(exception, textDocument, this.getTokenMap(),cursorPosition);
    }else if (exception.substring(0,2).equals("LE")) {
      possibilitiesList = this.testForTokensLE(exception, textDocument, this.getTokenMap(), cursorPosition);
    else {
      possibilitiesList = this.testforTokensNE(textDocument, this.getTokenMap(), cursorPosition);
    }
    if (possibilitiesList!=null) {
      //hier werden unpassende Vorschlaege aussortiert
      for (int i = 0; i < possibilitiesList.size(); i++) {
        element_i = possibilitiesList.get(i);
        if (currentWord.equals("")||currentWord.equals(" ")) {
          returnList.add(element_i);
        } else if (cwLength <= element_i.getValue().length()) {

          if (element_i.getCaseSensitiv()) {
            if (currentWord.substring(0, cwLength).equals(
                element_i.getValue().substring(0, cwLength))) {
              returnList.add(element_i);
            }
            //Wenn nicht case Sensitiv equalsIgnoreCase-Methode statt equals
          } else {
            if (currentWord.substring(0, cwLength).equalsIgnoreCase(
                element_i.getValue().substring(0, cwLength))) {
              returnList.add(element_i);

          }
          }
        }
View Full Code Here

        cursorPosition - currentWord.length()).length();
    //tokens des Dokuments bis zum aktuellen Wort werden in hashmap gespeichert
    final HashMap<Item, Integer> hashmap = this.tokensToMap(this.readerLocal, this.parserLocal,
        indexBeforeCurrentWord);

    Item rw_element_i;
    //restliche reservedWords werden ergaenzt
    for (int i = 0; i < this.reservedWords.size(); i++) {
      rw_element_i = new Item(this.reservedWords.get(i).toString(), false);
      if (!hashmap.containsKey(rw_element_i)) {
        hashmap.put(rw_element_i, 0);
      }
    }
    final List<Entry<Item, Integer>> list = new ArrayList<Entry<Item, Integer>>(
View Full Code Here

          || splittedTokenLine[2].equals("PREFIXLABEL")
          || splittedTokenLine[2].equals("URI")
          || splittedTokenLine[2].equals("RESERVEDWORD"))) {

        final String tokenString = splittedTokenLine[9];
        Item item_i;
        if (semanticWebType.equals("RESERVEDWORD")) {
          item_i = new Item(tokenString, false);
        } else {
          item_i = new Item(tokenString, true);
        }

        if (!(hashmap.containsKey(item_i))) {
          hashmap.put(item_i, 1);
View Full Code Here

      /*
       * Falls currenWord leer ist bzw aus einem Leerzeichen besteht
       * werden alle reservedWords hinzugefuegt
       */
      if (currentWord.equals("") || currentWord.equals(" ")) {
        returnList.add(new Item(rw_element_i, false));
        // System.out.println(rw_element_i);

        /*
         * die Laenge von currentWord muss <= aller Laengen der
         * reservedWords sein
         */
      } else if ((cwLength) <= rw_element_i.length()) {

        /*
         * Vergleicht i-tes reservedWord mit currentWord, auch komplett
         * gross bzw klein geschrieben
         */
        if (currentWord.substring(0, cwLength).equalsIgnoreCase(
            rw_element_i.substring(0, cwLength))) {
          returnList.add(new Item(rw_element_i, false));
        }
      }
    }
    return this.generateWeight(returnList);
  }
View Full Code Here

TOP

Related Classes of lupos.autocomplete.misc.Item

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.