Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 
 package eu.clarin.weblicht.wlfxb.tc.test;
 

Author(s):
Yana Panchenko
    @Rule
    public TemporaryFolder testFolder = new TemporaryFolder();
    private static final String INPUT_FILE_WITHOUT_LAYER = "/data/tc-orth/tcf-before.xml";
    private static final String INPUT_FILE_WITH_LAYER = "/data/tc-orth/tcf-after.xml";
    private static final String EXPECTED_OUTPUT_FILE = "/data/tc-orth/output-expected.xml";
    private static final String OUTPUT_FILE = "output.xml";
    private static final EnumSet<TextCorpusLayerTaglayersToReadBeforeCorrections =
            EnumSet.of(.);
    private static final EnumSet<TextCorpusLayerTaglayersToReadAfterCorrections =
            EnumSet.of(..);
    private String corr1String = "will";
    private int corr1TokIndex = 1;
    public static final String corr2String = "essen";
    private int corr2TokIndex = 3;
    @Test
    public void testRead() throws Exception {
        OrthographyLayer layer = tc.getOrthographyLayer();
        Assert.assertEquals(2, layer.size());
        Assert.assertEquals("will"layer.getCorrection(0).getString());
        Assert.assertEquals(tc.getTokensLayer().getToken(1), layer.getTokens(layer.getCorrection(0))[0]);
    }
    @Test
    public void testReadWrite() throws Exception {
        String outfile = .getRoot() + . + ;
        ..println(tc);
        OrthographyLayer layer = tc.createOrthographyLayer();
        Token token;
        token = tc.getTokensLayer().getToken();
        layer.addCorrection(token);
        token = tc.getTokensLayer().getToken();
        layer.addCorrection(token);
        // IMPORTANT close the streams!!!
        tc.close();
        ..println(tc);
        // compare output xml with expected xml
        assertEqualXml(outfile);
    }
New to GrepCode? Check out our FAQ X