Beispiel #1
0
func TestSimpleReadWrite(t *testing.T) {
	fcfg := "testdata/config_simpleread.dsv"

	reader, e := dsv.SimpleRead(fcfg, nil)
	if e != nil {
		t.Fatal(e)
	}

	fout := "testdata/output.dat"
	fexp := "testdata/expected.dat"

	_, e = dsv.SimpleWrite(reader, fcfg)
	if e != nil {
		t.Fatal(e)
	}

	assertFile(t, fexp, fout, true)
}
Beispiel #2
0
func TestSimpleMerge(t *testing.T) {
	fcfg1 := "testdata/config_simpleread.dsv"
	fcfg2 := "testdata/config_simpleread.dsv"

	reader, e := dsv.SimpleMerge(fcfg1, fcfg2, nil, nil)
	if e != nil {
		t.Fatal(e)
	}

	_, e = dsv.SimpleWrite(reader, fcfg1)
	if e != nil {
		t.Fatal(e)
	}

	fexp := "testdata/expected_simplemerge.dat"
	fout := "testdata/output.dat"

	assertFile(t, fexp, fout, true)
}
Beispiel #3
0
func main() {
	defer un(trace("Unified PAN-WVC-2011"))

	dataset := tabula.Dataset{}

	readset, e := dsv.SimpleRead(fEditsDsv, &dataset)
	if e != nil {
		panic(e)
	}
	fmt.Printf(">>> merging %d rows\n", dataset.GetNRow())

	fmt.Println(">>> diffing ...")
	doDiff(readset, &dataset)

	fmt.Println(">>> writing ...")
	n, e := dsv.SimpleWrite(readset, fEditsDsv)
	if e != nil {
		panic(e)
	}
	fmt.Printf(">>> writing %d rows\n", n)
}
Beispiel #4
0
func main() {
	defer un(trace("Unified PAN-WVC-2010"))

	readset, e := dsv.SimpleMerge(fEditsDsv, fGoldAnnotationsDsv, nil, nil)
	if e != nil {
		panic(e)
	}

	dataset := readset.GetDataset().(tabula.DatasetInterface)
	fmt.Printf(">>> merging %d rows\n", dataset.GetNRow())

	fmt.Println(">>> diffing ...")
	doDiff(readset, dataset)

	fmt.Println(">>> writing ...")
	n, e := dsv.SimpleWrite(readset, fOutDsv)
	if e != nil {
		panic(e)
	}
	fmt.Printf(">>> writing %d rows\n", n)
}