Examples of ModelParseException


Examples of net.sourceforge.align.model.ModelParseException

        String[] parts = line.split("\\s");
        if (parts.length == 2) {
          int wid = Integer.parseInt(parts[0]);
          String word = parts[1];
          if (wid != expectedWid) {
            throw new ModelParseException("Word ordering error");
          }
          vocabulary.putWord(word);
          ++expectedWid;
        } else if (parts.length != 0) {
          throw new ModelParseException("Bad number of " +
              "line parts.");
        }
      }
      return vocabulary;
    } catch (NumberFormatException e) {
      throw new ModelParseException("Part format error", e);
    } catch (IOException e) {
      throw new ModelParseException("IO error", e);
    }
  }
View Full Code Here

Examples of net.sourceforge.align.model.ModelParseException

        if (parts.length == 2) {
          int wid = Integer.parseInt(parts[0]);
          int count = Integer.parseInt(parts[1]);
          languageModel.addWordOccurence(wid, count);
        } else if (parts.length != 0) {
          throw new ModelParseException("Bad number of line parts.");
        }
      }
      languageModel.normalize();
      return languageModel;
    } catch (NumberFormatException e) {
      throw new ModelParseException("Part format error", e);
    } catch (IOException e) {
      throw new ModelParseException("IO error", e);
    }
  }
View Full Code Here

Examples of net.sourceforge.align.model.ModelParseException

          MutableSourceData sourceData =
            translationModel.getMutable(sourceWid);
          sourceData.setTranslationProbability(targetWid, probability);
        } else if (parts.length != 0) {
          throw new ModelParseException("Bad number of " +
              "line parts.");
        }
      }
      translationModel.normalize();
      translationModel.sort();
      return translationModel;
    } catch (NumberFormatException e) {
      throw new ModelParseException("Part format error", e);
    } catch (IOException e) {
      throw new ModelParseException("IO error", e);
    }
  }
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

            source = getSource();
        }

        if ( line <= 0 && column <= 0 && cause instanceof ModelParseException )
        {
            ModelParseException e = (ModelParseException) cause;
            line = e.getLineNumber();
            column = e.getColumnNumber();
        }

        ModelProblem problem = new DefaultModelProblem( message, severity, source, line, column, modelId, cause );

        add( problem );
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

            source = getSource();
        }

        if ( line <= 0 && column <= 0 && req.getException() instanceof ModelParseException )
        {
            ModelParseException e = (ModelParseException) req.getException();
            line = e.getLineNumber();
            column = e.getColumnNumber();
        }

        ModelProblem problem =
            new DefaultModelProblem( req.getMessage(), req.getSeverity(), req.getVersion(), source, line, column,
                                     modelId, req.getException() );
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

            source = getSource();
        }

        if ( line <= 0 && column <= 0 && cause instanceof ModelParseException )
        {
            ModelParseException e = (ModelParseException) cause;
            line = e.getLineNumber();
            column = e.getColumnNumber();
        }

        ModelProblem problem = new DefaultModelProblem( message, severity, source, line, column, modelId, cause );

        add( problem );
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

        int line = -1;
        int column = -1;

        if ( cause instanceof ModelParseException )
        {
            ModelParseException e = (ModelParseException) cause;
            line = e.getLineNumber();
            column = e.getColumnNumber();
        }

        add( severity, message, line, column, cause );
    }
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

            MavenXpp3Reader r = new MavenXpp3Reader();
            return r.read( input, isStrict( options ) );
        }
        catch ( XmlPullParserException e )
        {
            throw new ModelParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
        }
        finally
        {
            IOUtil.close( input );
        }
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

            MavenXpp3Reader r = new MavenXpp3Reader();
            return r.read( input, isStrict( options ) );
        }
        catch ( XmlPullParserException e )
        {
            throw new ModelParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
        }
        finally
        {
            IOUtil.close( input );
        }
View Full Code Here

Examples of org.apache.maven.model.io.ModelParseException

        int line = -1;
        int column = -1;

        if ( cause instanceof ModelParseException )
        {
            ModelParseException e = (ModelParseException) cause;
            line = e.getLineNumber();
            column = e.getColumnNumber();
        }

        add( message, ModelProblem.Severity.FATAL, line, column, cause );
    }
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.