Package org.maltparserx.core.io.dataformat

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


 
  private 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


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

  }
View Full Code Here

 
  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

      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(NEWLINE);
        columns = dataFormatInstance.iterator();
      } catch (IOException e) {
        close();
        throw new DataFormatException("Could not write to the output file. ", e);
      }
    }
   
    try {
      writer.write('\n');
      writer.flush();
    } catch (IOException e) {
      close();
      throw new DataFormatException("Could not write to the output 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

    try {
      if (graphWriterClass != null) {
        this.graphWriterClass = graphWriterClass.asSubclass(org.maltparserx.core.syntaxgraph.writer.SyntaxGraphWriter.class);
      }
    } catch (ClassCastException e) {
      throw new DataFormatException("The class '"+graphWriterClass.getName()+"' is not a subclass of '"+org.maltparserx.core.syntaxgraph.writer.SyntaxGraphWriter.class.getName()+"'. ", e);
    }
  }
View Full Code Here

        writer.open(outputFile, outputCharSet);
      }
      writer.setDataFormatInstance(outputDataFormatInstance);
      writer.setOptions(writerOption);
    } catch (InstantiationException e) {
      throw new DataFormatException("The data writer '"+syntaxGraphWriterClass.getName()+"' cannot be initialized. ", e);
    } catch (IllegalAccessException e) {
      throw new DataFormatException("The data writer '"+syntaxGraphWriterClass.getName()+"' cannot be initialized. ", e);
    }
  }
View Full Code Here

    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

    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

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.