Package org.maltparserx.core.io.dataformat

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


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


  private void open(InputStreamReader isr) throws MaltChainedException {
    try {
      XMLInputFactory factory = XMLInputFactory.newInstance();
      setReader(factory.createXMLStreamReader(new BufferedReader(isr)));
    } catch (XMLStreamException e) {
      throw new DataFormatException("XML input file could be opened. ", e);
    }
    setSentenceCount(0);
  }
View Full Code Here

//            }
//          }
        }
      }
    } catch (XMLStreamException e) {
      throw new DataFormatException("", e);
    }
  }
View Full Code Here

          reader.close();
        }
        reader = null;
      }
    } catch (XMLStreamException e) {
      throw new DataFormatException("The XML input file could be closed. ", e);
    }
  }
View Full Code Here

    try {
//      this.fileName = fileName;
//      this.charsetName = charsetName;
      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

      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

          writer.write("        <nonterminals/>\n");
        }
        writer.write("      </graph>\n");
        writer.write("    </s>\n");
      } catch (IOException e) {
        throw new DataFormatException("The TigerXML writer could not write to file. ", e);
      }
    }
  }
View Full Code Here

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

        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

        }
        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

TOP

Related Classes of org.maltparserx.core.io.dataformat.DataFormatException

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.