Giter VIP home page Giter VIP logo

agiga's People

Watchers

 avatar

agiga's Issues

Problem with reading LDC Agiga files

What steps will reproduce the problem?
import edu.jhu.agiga.*;

public class Test {

        public static void main(String[] args) {
                long start = System.currentTimeMillis();
                long i = 0;
                String f = "/export/common/data/corpora/LDC/LDC2012T21/data/xml/apw_eng_200708.xml.gz";
                StreamingDocumentReader sdr = new StreamingDocumentReader(f, new AgigaPrefs());
                for(AgigaDocument doc : sdr) {
                        i++;
                        String t = String.format("%.1f seconds", (System.currentTimeMillis()-start)/1000d);
                        System.out.printf("docId[%d] = %s \t (%s)\n", i, doc.getDocId(), t);
                }
        }

}

What is the expected output? What do you see instead?
-> this should work smoothly, but it produces an exception:
....
docId[6356] = APW_ENG_20070810.0656      (152.2 seconds)
docId[6357] = APW_ENG_20070810.0658      (152.3 seconds)
docId[6358] = APW_ENG_20070810.0660      (152.3 seconds)
docId[6359] = APW_ENG_20070810.0662      (152.3 seconds)
Exception in thread "main" java.lang.IllegalStateException
        at edu.jhu.agiga.AgigaSentenceReader.require(AgigaSentenceReader.java:360)
        at edu.jhu.agiga.AgigaSentenceReader.parseTokens(AgigaSentenceReader.java:258)
        at edu.jhu.agiga.AgigaSentenceReader.next(AgigaSentenceReader.java:143)
        at edu.jhu.agiga.AgigaSentenceReader.next(AgigaSentenceReader.java:42)
        at edu.jhu.agiga.AgigaDocumentReader.next(AgigaDocumentReader.java:132)
        at edu.jhu.agiga.AgigaDocumentReader.next(AgigaDocumentReader.java:40)
        at edu.jhu.agiga.StreamingVtdXmlReader.next(StreamingVtdXmlReader.java:136)
        at Test.main(Test.java:12)



Original issue reported on code.google.com by [email protected] on 7 May 2013 at 3:30

NumberFormatException on numbers with \n

What steps will reproduce the problem?

1. Run AgigaPrinter on NYT_ENG_19940702.0235. 
2. The NumberFormatException stacktrace points to 
AgigaSentenceReader.parseTokens(VTDNav), line 247. The value of 
vn.toString(vn.getText()) is "3735\n" and this is passed to Integer.parseInt, 
hence the error.


Original issue reported on code.google.com by [email protected] on 9 May 2013 at 9:20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.