Skip to content

Commit

Permalink
Changed to understand both bracket and XML input, if specified as an …
Browse files Browse the repository at this point in the history
…argument. Defaults to XML if input is read from stdin.
  • Loading branch information
doches committed Sep 30, 2008
1 parent 01a3c37 commit 73e4de8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/test.rb
@@ -1,14 +1,22 @@
#!/usr/bin/ruby
require 'lib/xml2pt'

# Get parse tree(s)
input = ""
sentences = nil
if not ARGV[1].nil?
IO.foreach(ARGV[1]) { |l| input += l }
if ARGV[1] =~ /\.xml/
require 'lib/xml2pt'
sentences = XMLSentence.xml2parsetree(input)
else
require 'lib/bracket2pt'
sentences = BracketSentence.lines2parsetree(input.split("\n"))
end
else
require 'lib/xml2pt'
STDIN.each_line { |l| input += l }
sentences = XMLSentence.xml2parsetree(input)
end
sentences = XMLSentence.xml2parsetree(input)

# Get features
feature_file = ARGV[0]
Expand Down

0 comments on commit 73e4de8

Please sign in to comment.