diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..eb5a316
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+target
diff --git a/README.md b/README.md
index 62fe924..2e1a480 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,7 @@ The current logical structure of the XML schema of TextGrid files is pictured be
1
0
2
-
+
@@ -63,11 +63,13 @@ The example data originates from the [Phonetic Corpus of Estonian Spontaneous Sp
## Creating XML from Praat TextGrid files
-The DFDL schema has been developed and tested using the open source tool [Daffodil](https://opensource.ncsa.illinois.edu/confluence/display/DFDL).
+The DFDL schema has been developed and tested using the open source tool [Apache Daffodil](https://daffodil.apache.org).
Parsing the example TextGrid file.
```shell
-$ ../bin/daffodil parse --schema ./PraatTextGrid.dfdl.xsd ./examples/ekskfk_miski_1.TextGrid
+$ daffodil parse -TsuppressSchemaDefinitionWarnings=encodingErrorPolicyError \
+ --schema src/main/resources/com/github/keeleleek/praattextgrid/PraatTextGrid.dfdl.xsd \
+ src/test/resources/examples/ekskfk_miski_1.TextGrid
```
## Creating Praat TextGrid files from XML
@@ -75,5 +77,7 @@ $ ../bin/daffodil parse --schema ./PraatTextGrid.dfdl.xsd ./examples/ekskfk_misk
Un-parsing the parsed example XML infoset back to TextGrid text file.
```shell
-$ ../bin/daffodil unparse --schema ./PraatTextGrid.dfdl.xsd ./examples/ekskfk_miski_1.tdml
+$ daffodil unparse -TsuppressSchemaDefinitionWarnings=encodingErrorPolicyError \
+ --schema src/main/resources/com/github/keeleleek/praattextgrid/PraatTextGrid.dfdl.xsd \
+ src/test/resources/examples/ekskfk_miski_1.TextGrid.xml
```
diff --git a/build.sbt b/build.sbt
new file mode 100644
index 0000000..1634d9a
--- /dev/null
+++ b/build.sbt
@@ -0,0 +1,17 @@
+name := "dfdl-praat-textgrid"
+
+organization := "com.github.keeleleek"
+
+version := "0.0.1-SNAPSHOT"
+
+scalaVersion := "2.12.11"
+
+libraryDependencies ++= Seq(
+ "org.apache.daffodil" %% "daffodil-tdml-processor" % "2.6.0" % "test",
+ "com.novocode" % "junit-interface" % "0.11" % "test",
+ "junit" % "junit" % "4.12" % "test",
+)
+
+testOptions += Tests.Argument(TestFrameworks.JUnit, "-v")
+
+crossPaths := false
diff --git a/project/build.properties b/project/build.properties
new file mode 100644
index 0000000..06703e3
--- /dev/null
+++ b/project/build.properties
@@ -0,0 +1 @@
+sbt.version=1.3.9
diff --git a/PraatTextGrid.dfdl.xsd b/src/main/resources/com/github/keeleleek/praattextgrid/PraatTextGrid.dfdl.xsd
similarity index 98%
rename from PraatTextGrid.dfdl.xsd
rename to src/main/resources/com/github/keeleleek/praattextgrid/PraatTextGrid.dfdl.xsd
index f6f69c0..9c0d010 100644
--- a/PraatTextGrid.dfdl.xsd
+++ b/src/main/resources/com/github/keeleleek/praattextgrid/PraatTextGrid.dfdl.xsd
@@ -4,10 +4,9 @@
xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/"
xmlns:ex="http://example.com"
targetNamespace="http://example.com"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
+ elementFormDefault="qualified">
-
+
diff --git a/lib/built-in-formats.xsd b/src/main/resources/com/github/keeleleek/praattextgrid/built-in-formats.xsd
similarity index 97%
rename from lib/built-in-formats.xsd
rename to src/main/resources/com/github/keeleleek/praattextgrid/built-in-formats.xsd
index a6168a2..430ebe9 100644
--- a/lib/built-in-formats.xsd
+++ b/src/main/resources/com/github/keeleleek/praattextgrid/built-in-formats.xsd
@@ -30,7 +30,7 @@
utf16Width="fixed" textStandardDecimalSeparator="."
textStandardGroupingSeparator="," textStandardExponentRep="E"
textStandardZeroRep="0" textStandardInfinityRep="Inf"
- textStandardNaNRep="NaN" textNumberPattern="#,##0.###;-#,##0.###"
+ textStandardNaNRep="NaN" textNumberPattern="#,##0.###############;-#,##0.###############"
textNumberRounding="explicit" textNumberRoundingMode="roundUnnecessary"
textNumberRoundingIncrement="0" decimalSigned="yes"/>
diff --git a/examples/ekskfk_miski_1.TextGrid b/src/test/resources/examples/ekskfk_miski_1.TextGrid
similarity index 100%
rename from examples/ekskfk_miski_1.TextGrid
rename to src/test/resources/examples/ekskfk_miski_1.TextGrid
diff --git a/examples/ekskfk_miski_1.tdml b/src/test/resources/examples/ekskfk_miski_1.TextGrid.xml
similarity index 95%
rename from examples/ekskfk_miski_1.tdml
rename to src/test/resources/examples/ekskfk_miski_1.TextGrid.xml
index 82ca7fe..548513a 100644
--- a/examples/ekskfk_miski_1.tdml
+++ b/src/test/resources/examples/ekskfk_miski_1.TextGrid.xml
@@ -1,4 +1,4 @@
-
+
ooTextFile
TextGrid
0.0
@@ -82,7 +82,7 @@
2
0.061199346418562
0.40788261011471
-
+
3
@@ -260,7 +260,7 @@
2
0.061199346418562
0.40788261011471
-
+
3
@@ -438,7 +438,7 @@
2
0.061199346418562
0.40788261011471
-
+
3
@@ -526,7 +526,7 @@
2
0.061199346418562
0.40788261011471
-
+
3
@@ -578,7 +578,7 @@
2
0.061199346418562
0.40788261011471
-
+
3
@@ -658,7 +658,7 @@
1
0.0
2.0
-
+
@@ -674,7 +674,7 @@
1
0.0
0.061199346418562
-
+
2
@@ -686,7 +686,7 @@
3
0.40788261011471
2.0
-
+
@@ -702,9 +702,9 @@
1
0.0
2.0
-
+
-
+
diff --git a/src/test/resources/textgrid.tdml b/src/test/resources/textgrid.tdml
new file mode 100644
index 0000000..d320a3e
--- /dev/null
+++ b/src/test/resources/textgrid.tdml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+ encodingErrorPolicyError
+
+
+
+
+
+
+ examples/ekskfk_miski_1.TextGrid
+
+
+ examples/ekskfk_miski_1.TextGrid.xml
+
+
+
+
diff --git a/src/test/scala/TestPraatTextGrid.scala b/src/test/scala/TestPraatTextGrid.scala
new file mode 100644
index 0000000..1e1db96
--- /dev/null
+++ b/src/test/scala/TestPraatTextGrid.scala
@@ -0,0 +1,20 @@
+package com.gitub.keeleleek.praattextgrid
+
+import org.apache.daffodil.tdml.Runner
+import org.junit.Test
+import org.junit.AfterClass
+
+object TestPraatTextGrid {
+ lazy val runner = new Runner("/", "textgrid.tdml")
+
+ @AfterClass def shutDown {
+ runner.reset
+ }
+}
+
+class TestPraatTextGrid {
+ import TestPraatTextGrid._
+
+ @Test def test_ekskfk_miski_1() { runner.runOneTest("ekskfk_miski_1") }
+
+}