Examples of DataFormatException


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

    if (fileName != null) {
      open(fileName, charsetName);
    } else if (url != null) {
      open(url, charsetName);
    } else {
      throw new DataFormatException("The input stream cannot be reopen. ");
    }
  }
View Full Code Here

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

    setFileName(fileName);
    setCharsetName(charsetName);
    try {
      open(new FileInputStream(fileName), charsetName);
    }catch (FileNotFoundException e) {
      throw new DataFormatException("The input file '"+fileName+"' cannot be found. ", e);
    }
  }
View Full Code Here

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

    setUrl(url);
    setCharsetName(charsetName);
    try {
      open(url.openStream(), charsetName);
    } catch (IOException e) {
      throw new DataFormatException("The URL '"+url.toString()+"' cannot be opened. ", e);
    }
  }
View Full Code Here

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

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

  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

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

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

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

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

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

    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

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

          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
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.