hGetContents and laziness in file io

Hal Daume hdaume@ISI.EDU
Tue, 24 Jul 2001 12:17:55 -0700 (PDT)

Okay, I understand the problem.  I would do something like the solution
you propose, except that in the input file, trees span multiple lines.  So
the input file looks something like:

(:cat S
 :subs ((() (:cat NP
             :subs ((() (:surf "John")))))
        (() (:cat VP
             :subs ((() (:surf "bought"))
                    (() (:cat NP
                         :subs ((() (:surf "two"))
                                (() (:surf "cars"))))))))
        (() (:surf "."))))

and then there will be another one directly following it (i detect the
breaks because each one is completely surrounded in parens).

So a line-by-line parse solution won't really do the job...