Examples of DataFormatException


Examples of org.maltparserx.core.io.dataformat.DataFormatException

          writer.close();
        }
        writer = null;
      }
    }   catch (IOException e) {
      throw new DataFormatException("Could not close the output file. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

        header = new TigerXMLHeader(dataFormatInstance.getSymbolTables());
      }
      writer.write(header.toTigerXML());
//      hasWriteTigerXMLHeader = true;
    } catch (IOException e) {
      throw new DataFormatException("The TigerXML writer could not write to file. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

        }
        writer.write("/>\n");
      }
      writer.write("        </terminals>\n");
    } catch (IOException e) {
      throw new DataFormatException("The TigerXML writer is not able to write. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

      }
     
      writeNonTerminal((NonTerminalNode)phraseStructure.getPhraseStructureRoot(),rootID.toString());
      writer.write("        </nonterminals>\n");
    } catch (IOException e) {
      throw new DataFormatException("The TigerXML writer is not able to write. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

        }
        writer.write(" />\n");
      }
      writer.write("          </nt>\n");
    } catch (IOException e) {
      throw new DataFormatException("The TigerXML writer is not able to write. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

//        headerWriter.write(header.toTigerXML());
//        headerWriter.flush();
//        headerWriter.close();
//      }
    } catch (IOException e) {
      throw new DataFormatException("The TigerXML writer is not able to write. ", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

    String[] argv;
    try {
      argv = optionString.split("[_\\p{Blank}]");
    } catch (PatternSyntaxException e) {
      throw new DataFormatException("Could not split the TigerXML writer option '"+optionString+"'. ", e);
    }
    for (int i=0; i < argv.length-1; i++) {
      if(argv[i].charAt(0) != '-') {
        throw new DataFormatException("The argument flag should start with the following character '-', not with "+argv[i].charAt(0));
      }
      if(++i>=argv.length) {
        throw new DataFormatException("The last argument does not have any value. ");
      }
      switch(argv[i-1].charAt(1)) {
      case 'r':
        if (argv[i].equals("n")) {
          rootHandling = RootHandling.NORMAL;
        } else if (argv[i].equals("tal")) {
          rootHandling = RootHandling.TALBANKEN;
        }
        break;
      case 's':
        try {
          START_ID_OF_NONTERMINALS = Integer.parseInt(argv[i]);
        } catch (NumberFormatException e){
          throw new MaltChainedException("The TigerXML writer option -s must be an integer value. ");
        }
        break;
      case 'v':
        VROOT_SYMBOL = argv[i];
        break
      default:
        throw new DataFormatException("Unknown TigerXML writer option: '"+argv[i-1]+"' with value '"+argv[i]+"'. ");   
      }
    } 
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

 
  public void open(String fileName, String charsetName) throws MaltChainedException {
    try {
      open(new OutputStreamWriter(new FileOutputStream(fileName),charsetName));
    } catch (FileNotFoundException e) {
      throw new DataFormatException("The output file '"+fileName+"' cannot be found.", e);
    } catch (UnsupportedEncodingException e) {
      throw new DataFormatException("The character encoding set '"+charsetName+"' isn't supported.", e);
   
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

      if (os == System.out || os == System.err) {
        closeStream = false;
      }
      open(new OutputStreamWriter(os, charsetName));
    } catch (UnsupportedEncodingException e) {
      throw new DataFormatException("The character encoding set '"+charsetName+"' isn't supported.", e);
    }
  }
View Full Code Here

Examples of org.maltparserx.core.io.dataformat.DataFormatException

      } else {
        writer.write(Integer.toString(sentenceCount));
      }
      writer.write('\n');
    } catch (IOException e) {
      throw new DataFormatException("Could not write to the output file. ", e);
    }
  }
View Full Code Here
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.