src/main/java/eu/digitisation/langutils/TermFrequency.java
public void addFile(File file) throws WarningException, SchemaLocationException {
        try {
            Text content = new Text(file);
            WordScanner scanner = new WordScanner(content.toString(), 
                    "[^\\p{Space}]+");
            String word;
            while ((word = scanner.nextWord()) != null) {
                String filtered = (filter == null)
                        ? word : filter.translate(word);
                inc(StringNormalizer.composed(filtered));
            }
        } catch (IOException ex) {
            Messages.info(TermFrequency.class.getName() + ": " + ex);
        }

    }
/**
     * Extract words from a file
     *
     * @param file an input files
     * @throws eu.digitisation.input.WarningException
     * @throws eu.digitisation.input.SchemaLocationException
     */
Extract words from a file
@param file an input files
@throws eu.digitisation.input.WarningException
@throws eu.digitisation.input.SchemaLocationException
Extract words from a file @param file an input files @throws eu . digitisation . input . WarningException @throws eu . digitisation . input . SchemaLocationException
public void addFile(File file) throws WarningException, SchemaLocationException {
        try {
            Text content = new Text(file);
            WordScanner scanner = new WordScanner(content.toString(), 
                    "[^\\p{Space}]+");
            String word;
            while ((word = scanner.nextWord()) != null) {
                String filtered = (filter == null)
                        ? word : filter.translate(word);
                inc(StringNormalizer.composed(filtered));
            }
        } catch (IOException ex) {
            Messages.info(TermFrequency.class.getName() + ": " + ex);
        }
    }
public void addFile ( File file ) throws WarningException , SchemaLocationException { try { Text content = new Text ( file ) ; WordScanner scanner = new WordScanner ( content . toString ( ) , "[^\\p{Space}]+" ) ; String word ; while ( ( word = scanner . nextWord ( ) ) != null ) { String filtered = ( filter == null ) ? word : filter . translate ( word ) ; inc ( StringNormalizer . composed ( filtered ) ) ; } } catch ( IOException ex ) { Messages . info ( TermFrequency . class . getName ( ) + ": " + ex ) ; } }
Extract words from a file
 @param file an input files
 @throws eu.digitisation.input.WarningException
 @throws eu.digitisation.input.SchemaLocationException
Extract words from a file @param file an input files @throws eu . digitisation . input . WarningException @throws eu . digitisation . input . SchemaLocationException