Hello all,

I have been trying to build modelbuilder-addon and I have realized that are
few errors:

Some are quite easy to fix which are override annotations that are not
compatible with the impemented/exteded base case.

It can be seen at the
classes FileKnownEntityProvider, FileModelValidatorImpl,
GenericModelGenerator, GenericModelableImpl.

However, the import MarkableFileInputStreamFactory on GenericModelableImpl
cannot be seen because the class is not public.

I wonder, if I should review that, make it public, and build opennlp-tools
again from trunk.

Or even create a local class to modelbuilder-addon with same functionality.

Of course, it is fixable just do not want to compile code different from
the tree.

Looking at commit logs, there have not been anything recent to address that.

In that case, I believe it is a build bug/error that needs to be correct.

Thanks,




/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package opennlp.tools.cmdline;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import opennlp.tools.util.InputStreamFactory;

/**
 * A factory that creates {@link MarkableFileInputStream} from a {@link
File}
 */
class MarkableFileInputStreamFactory implements InputStreamFactory {

  private File file;

  public MarkableFileInputStreamFactory(File file) throws
FileNotFoundException {
    if(!file.exists()) {
      throw new FileNotFoundException("File '" + file + "' cannot be
found");
    }
    this.file = file;
  }

  @Override
  public InputStream createInputStream() throws IOException {
    return new MarkableFileInputStream(file);
  }
}

Reply via email to