Package org.maltparserx.core.symbol

Examples of org.maltparserx.core.symbol.SymbolException


 
  public String getSymbolCodeToString(int code) throws MaltChainedException {
    if (code >= 0) {
      if (nullValues == null || !nullValues.isNullValue(code)) {
        if (trie == null) {
          throw new SymbolException("The symbol table is corrupt. ");
        }
        if (this.symbolTableMode == TrieSymbolTableHandler.ADD_NEW_TO_TRIE) {
          return trie.getValue(codeTable.get(code), this);
        } else {
          TrieNode node = codeTable.get(code);
          if (node != null) {
            return trie.getValue(node, this);
          } else {
            return tmpStorageIntStrMap.get(code);
          }
        }
      } else {
        return nullValues.codeToSymbol(code);
      }
    } else {
      throw new SymbolException("The symbol code '"+code+"' cannot be found in the symbol table. ");
    }
  }
View Full Code Here


 
  public int getSymbolStringToCode(String symbol) throws MaltChainedException {
    if (symbol != null) {
      if (nullValues == null || !nullValues.isNullValue(symbol)) {
        if (trie == null) {
          throw new SymbolException("The symbol table is corrupt. ");
        }
        if (this.symbolTableMode == TrieSymbolTableHandler.ADD_NEW_TO_TRIE) {
          final Integer entry = trie.getEntry(symbol, this);
          if (entry == null) {
            throw new SymbolException("Could not find the symbol '"+symbol+"' in the symbol table. ");
          }
          return entry.intValue();
        } else {
          final Integer entry = trie.getEntry(symbol, this);
          if (entry != null) {
            return entry.intValue();
          } else {
            Integer tmpEntry = tmpStorageStrIntMap.get(symbol);
            if (tmpEntry == null) {
              throw new SymbolException("Could not find the symbol '"+symbol+"' in the symbol table. ");
            }
            return tmpEntry.intValue();
          }
        }
      } else {
        return nullValues.symbolToCode(symbol);
      }
    } else {
      throw new SymbolException("The symbol code '"+symbol+"' cannot be found in the symbol table. ");
    }
  }
View Full Code Here

      out.append(Integer.toString(getColumnCategory()));
      out.append('\t');
      out.append(getNullValueStrategy());
      out.append('\n');
    } catch (IOException e) {
      throw new SymbolException("Could not save the symbol table. ", e);
    }
  }
View Full Code Here

        out.write(trie.getValue(codeTable.get(code), this));
        out.write('\n');
      }
      out.write('\n');
    } catch (IOException e) {
      throw new SymbolException("Could not save the symbol table. ", e);
    }
  }
View Full Code Here

        if (max < code) {
          max = code;
        }
      }
    } catch (NumberFormatException e) {
      throw new SymbolException("The symbol table file (.sym) contains a non-integer value in the first column. ", e);
    } catch (IOException e) {
      throw new SymbolException("Could not load the symbol table. ", e);
    }
  }
View Full Code Here

    return valueCounter++;
  }
 
  public int getNullValueCode(NullValueId nullValueIdentifier) throws MaltChainedException {
    if (nullValues == null) {
      throw new SymbolException("The symbol table does not have any null-values. ");
    }
    return nullValues.nullvalueToCode(nullValueIdentifier);
  }
View Full Code Here

    return nullValues.nullvalueToCode(nullValueIdentifier);
  }
 
  public String getNullValueSymbol(NullValueId nullValueIdentifier) throws MaltChainedException {
    if (nullValues == null) {
      throw new SymbolException("The symbol table does not have any null-values. ");
    }
    return nullValues.nullvalueToSymbol(nullValueIdentifier);
  }
View Full Code Here

    return symbol2CodeMap.containsKey(symbol);
  }
 
  public int nullvalueToCode(NullValueId nullValueIdentifier) throws MaltChainedException {
    if (!nullValue2CodeMap.containsKey(nullValueIdentifier)) {
      throw new SymbolException("Illegal null-value identifier. ");
    }
    return nullValue2CodeMap.get(nullValueIdentifier);
  }
View Full Code Here

TOP

Related Classes of org.maltparserx.core.symbol.SymbolException

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.