Changeset ab150902d8bf8e8a9205d721adf0f28017bc0ec0

Show
Ignore:
Timestamp:
06/12/2008 11:15:47 AM (2 months ago)
Author:
mitchell <mitchell@frost.(none)>
git-committer:
mitchell <mitchell@frost.(none)> 1213294547 -0400
git-parent:

[2261256d076e9c65629ee11392c649b90bb74a18]

git-author:
mitchell <mitchell@frost.(none)> 1213294547 -0400
Message:

Added raw entity flag to Ohcount for debugging purposes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bin/ohcount

    r2261256 rab15090  
    9090  end 
    9191 
     92  def raw_entities 
     93    files.each do |file| 
     94      sfc = Ohcount::SimpleFileContext.new(file, files) 
     95      polyglot = Ohcount::Detector.detect(sfc) 
     96      if polyglot 
     97        Ohcount::parse_entities(sfc.contents, polyglot) do |language, entity, s, e| 
     98          puts "#{language}\t#{entity}\t#{s}\t#{e}" 
     99        end 
     100      end 
     101    end 
     102  end 
     103 
    92104  def help 
    93105    puts <<HELP 
     
    101113   -d, --detect 
    102114   -e, --entities 
     115   -re 
    103116   -h, --help 
    104117   -s, --summary 
     
    120133 
    121134   Prints the number of entities found for each language parsed. 
     135 
     136-re 
     137 
     138   Prints raw entity information to the screen (mainly for debugging). 
    122139 
    123140-h, --help                      Display this message 
     
    271288    when '-e', '--entities' 
    272289      self.subcommand = :entities 
     290    when '-re' 
     291      self.subcommand = :raw_entities 
    273292    #when /-n([\w_]+)/ 
    274293    # @entities ||= []