Changeset ab150902d8bf8e8a9205d721adf0f28017bc0ec0
- 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
| r2261256 |
rab15090 |
|
| 90 | 90 | end |
|---|
| 91 | 91 | |
|---|
| | 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 | |
|---|
| 92 | 104 | def help |
|---|
| 93 | 105 | puts <<HELP |
|---|
| … | … | |
| 101 | 113 | -d, --detect |
|---|
| 102 | 114 | -e, --entities |
|---|
| | 115 | -re |
|---|
| 103 | 116 | -h, --help |
|---|
| 104 | 117 | -s, --summary |
|---|
| … | … | |
| 120 | 133 | |
|---|
| 121 | 134 | 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). |
|---|
| 122 | 139 | |
|---|
| 123 | 140 | -h, --help Display this message |
|---|
| … | … | |
| 271 | 288 | when '-e', '--entities' |
|---|
| 272 | 289 | self.subcommand = :entities |
|---|
| | 290 | when '-re' |
|---|
| | 291 | self.subcommand = :raw_entities |
|---|
| 273 | 292 | #when /-n([\w_]+)/ |
|---|
| 274 | 293 | # @entities ||= [] |
|---|