Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml2ccg #20

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1177c12
Allowing unicode as a valid string type for lex.py:input.
shoeffner Nov 18, 2018
fb64047
Removing ccg-editor.py in favor of the up-to-date ccg_editor.py
shoeffner Nov 18, 2018
d472650
Streamlining whitespace in ccg_editor and related build files.
shoeffner Nov 18, 2018
9ddc011
Removing trailing whitespace in lex.py.
shoeffner Nov 18, 2018
b5fd0b1
Converting ccg2xml to Python 3
shoeffner Nov 20, 2018
b03b7b9
Using self.next instead of self.__next__ for Tree navigation.
shoeffner Nov 20, 2018
d102857
Using ttk to make tkinter work on MacOS.
shoeffner Nov 21, 2018
bc3fce2
Fixes indentation errors from the 2to3 conversion.
shoeffner Nov 21, 2018
3330877
Call python3 explicitly in ccg2xml
shoeffner Nov 21, 2018
1c4e209
Adding executables for xml2ccg.
shoeffner Nov 21, 2018
4a6509a
Adding xml2ccg to build.xml.
shoeffner Nov 21, 2018
1241cbc
Adding dummy files for xml2ccg and its test to start tracking them.
shoeffner Nov 21, 2018
04a04fe
Adding readily available test cases.
shoeffner Nov 21, 2018
9b3902c
xml2ccg: Basic program and test structure
shoeffner Nov 21, 2018
72773a5
Adding testbed conversion.
shoeffner Nov 21, 2018
ebd1388
Adding first part of feature xml2ccg conversion.
shoeffner Nov 22, 2018
2d9e732
Adding relation-sorting to feature.
shoeffner Nov 22, 2018
c832e04
Adding "known failures"-handling (!) to testbed.
shoeffner Nov 22, 2018
29b20a0
Adding rules section for ccg files.
shoeffner Nov 22, 2018
3793955
Adding default value of 1 for the numOfParses in the testbed, as sugg…
shoeffner Nov 22, 2018
e536b54
Fixing undefined warning_count
shoeffner Nov 22, 2018
d09a02e
Prettyfied XML test output, fixing test case stdin-seek(0) issues.
shoeffner Nov 22, 2018
39de715
Ignoring order in type parents during tests.
shoeffner Nov 22, 2018
a6a6775
Handling multiple inheritance parents in type hierarchy properly.
shoeffner Nov 22, 2018
502d24c
Adding feature structure ids/syntactic macros to features (the values…
shoeffner Nov 23, 2018
d1dd9b9
Adding ValueError if family/part-of-speech is not found, instead of r…
shoeffner Nov 23, 2018
e69474e
Adding words declarations.
shoeffner Nov 23, 2018
78cdbf0
Renaming feature_sec to feature_section to be aligned with other vari…
shoeffner Nov 23, 2018
19216a1
Added documentation to Word methods, simplified for loop to map in cc…
shoeffner Nov 23, 2018
50f679f
Adding family/category support.
shoeffner Nov 26, 2018
4c82b71
Handling additional word attributes "pred", "excluded", and "coart".
shoeffner Nov 26, 2018
44b743e
Improving family parsing, works for arabic grammar and punctuation no…
shoeffner Nov 26, 2018
17a9d17
Adding proper rule parsing for typeraise and typechange rules using t…
shoeffner Nov 26, 2018
f23fa08
Removing executable permission from README, arabic.ccg, and ccg.ply.
shoeffner Nov 26, 2018
3ae471f
Sorting of xml tree elements now also takes attributes and their valu…
shoeffner Nov 27, 2018
f9507fd
Using maybe_quote to avoid issues with . in identifiers.
shoeffner Nov 27, 2018
22660c8
Updating the slash handling to match the behaviour expected by ccg2xm…
shoeffner Nov 27, 2018
c5f77f8
Creating deep instead of shallow copies for morph entries.
shoeffner Nov 28, 2018
01093a5
Generated XMLs may be longer than the input.
shoeffner Nov 28, 2018
fe2d1d1
Allowing + and % as normal letters which do not need quotes.
shoeffner Nov 29, 2018
7ce3ccb
Adding a test workaround for 'forced' macros
shoeffner Nov 29, 2018
b370880
Adding diaspace grammar as a 'handcrafted' test case.
shoeffner Nov 29, 2018
7705a20
Adding support for implicit macro features.
shoeffner Nov 29, 2018
c5511d4
Adding more documentation to the xml2ccg script.
shoeffner Nov 29, 2018
9d81d7e
Adding bin/xml2ccg.py to the .gitignore
shoeffner Nov 29, 2018
2decc3b
Recursively comparing subtrees.
shoeffner Dec 5, 2018
3cb25f6
Adding members to families. Fixing nested complexcats to be parenthes…
shoeffner Dec 6, 2018
c8a587d
visccg handles family names containing quotes.
shoeffner Dec 11, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ vocab.*
.project
.classpath
bin/ccg2xml.py
bin/xml2ccg.py
bin/lex.py
bin/yacc.py
bin/ccg_editor.py
Expand Down
923 changes: 0 additions & 923 deletions bin/ccg-editor.py

This file was deleted.

2 changes: 1 addition & 1 deletion bin/ccg2xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

python "$OPENCCG_HOME/bin/ccg2xml.py" "$@"
python3 "$OPENCCG_HOME/bin/ccg2xml.py" "$@"
3 changes: 3 additions & 0 deletions bin/xml2ccg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

python3 "$OPENCCG_HOME/bin/xml2ccg.py" "$@"
2 changes: 2 additions & 0 deletions bin/xml2ccg.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
python %OPENCCG_HOME%/bin/xml2ccg.py %*
96 changes: 47 additions & 49 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<property name="build.dest" value="./output/classes"/>
<property name="build.gen" value="${top.dir}/output/gen"/>
<property name="build.javadocs" value="${docs.dir}/api"/>

<path id="build.classpath">
<pathelement location="${lib.dir}/ant-junit.jar"/>
<pathelement location="${lib.dir}/ant-launcher.jar"/>
Expand All @@ -57,7 +57,7 @@
<filter token="log" value="true"/>
<filter token="verbose" value="true"/>
</target>


<!-- =================================================================== -->
<!-- Help on usage -->
Expand All @@ -81,7 +81,7 @@
<echo message=""/>
<echo message=""/>
</target>


<!-- =================================================================== -->
<!-- Prepares the build directories -->
Expand All @@ -93,29 +93,28 @@
<mkdir dir="${build.gen}"/>
</target>


<!-- Runs JavaCC (parser generator) -->
<!-- =================================================================== -->
<target name="javacc"
depends="prepare"
description="generates parser using javacc">
<mkdir dir="${build.gen}/opennlp/ccgbank/parse"/>
<copy file="${src.dir}/opennlp/ccgbank/parse/SimpleNode.java"
todir="${build.gen}/opennlp/ccgbank/parse"/>
todir="${build.gen}/opennlp/ccgbank/parse"/>
<jjtree target="${src.dir}/opennlp/ccgbank/parse/CCGbankDerivation.jjt"
javacchome="${lib.dir}"
outputdirectory="${build.gen}/opennlp/ccgbank/parse"
/>
javacchome="${lib.dir}"
outputdirectory="${build.gen}/opennlp/ccgbank/parse" />
<javacc target="${build.gen}/opennlp/ccgbank/parse/CCGbankDerivation.jj"
outputdirectory="${build.gen}/opennlp/ccgbank/parse"
javacchome="${lib.dir}/"/>
outputdirectory="${build.gen}/opennlp/ccgbank/parse"
javacchome="${lib.dir}/" />
</target>


<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile"
<target name="compile"
depends="javacc"
description="compiles the source code">
<!-- compile generated JavaCC classes-->
Expand All @@ -125,37 +124,37 @@
deprecation="${deprecation}"
classpathref="build.classpath"
nowarn="true"
includeAntRuntime="false"
includeAntRuntime="false"
excludes="**/.backup.orig/**"
optimize="${optimize}"/>
optimize="${optimize}"/>
<javac srcdir="${src.dir}"
destdir="${build.dest}"
debug="${debug}"
deprecation="${deprecation}"
classpathref="build.classpath"
nowarn="true"
includeAntRuntime="false"
includeAntRuntime="false"
excludes="**/.backup.orig/**,srilmbridge/,kenlm/"
optimize="${optimize}">
</javac>
<subant antfile="${src.dir}/ccg2xml/build.xml" buildpath="${basedir}"/>
</target>


<!-- =================================================================== -->
<!-- Creates the jar file -->
<!-- =================================================================== -->
<target name="package"
<target name="package"
depends="compile"
description="generates the openccg.jar file (default)">
<jar jarfile="${lib.dir}/${name}.jar">
<fileset dir="${build.dest}">
<include name="**"/>
<exclude name="**/alignment/*Test*.class"/>
<exclude name="**/disjunctivizer/*Test*.class"/>
<exclude name="**/hylo/graph/*Test*.class"/>
<exclude name="**/util/*Test*.class"/>
</fileset>
<include name="**"/>
<exclude name="**/alignment/*Test*.class"/>
<exclude name="**/disjunctivizer/*Test*.class"/>
<exclude name="**/hylo/graph/*Test*.class"/>
<exclude name="**/util/*Test*.class"/>
</fileset>
<fileset dir="${src.dir}" includes="**/*.xsl"/>
<fileset dir="${src.dir}" includes="**/*.properties"/>
<!-- for grammardoc -->
Expand All @@ -164,7 +163,7 @@
</jar>
</target>


<!-- =================================================================== -->
<!-- Creates the release file -->
<!-- -->
Expand All @@ -174,17 +173,17 @@
<!-- =================================================================== -->
<target name="release" depends="document,package">
<subant antfile="${docs.dir}/build.xml" buildpath="${basedir}"
target="clean"/>
target="clean"/>
<antcall target="clean"/>
<tar tarfile="${name}-${version}.tar">
<tarfileset mode="755"
<tarfileset mode="755"
dir="../"
includes="${name}/bin/** ${name}/ccgbank/bin/**"/>
<tarfileset dir="../"
includes="${name}/**"
<tarfileset dir="../"
includes="${name}/**"
excludes="${name}/.* **/CVS **/bin/ **/.backup.orig/ ${name}/classes/** ${name}/output/** ${name}/src/srilmbridge/** ${name}/grammars/**/test/ ${name}/grammars/**/apml/"/>
</tar>
<gzip src="${name}-${version}.tar"
<gzip src="${name}-${version}.tar"
zipfile="../${name}-${version}.tgz" />
<delete file="${name}-${version}.tar" />
</target>
Expand All @@ -199,7 +198,7 @@
<!-- 3. cd cd /home/groups/o/op/openccg/htdocs -->
<!-- 4. put index.html -->
<!-- =================================================================== -->
<target name="homepage"
<target name="homepage"
depends="init,document"
description="generates the API documentation">
<tar tarfile="${name}-homepage.tar"
Expand All @@ -219,7 +218,7 @@
<mkdir dir="${build.javadocs}"/>
<javadoc packagenames="${packages}"
destdir="${build.javadocs}"
classpathref="build.classpath"
classpathref="build.classpath"
author="true"
version="true"
use="true"
Expand All @@ -228,15 +227,15 @@
windowtitle="${name}"
doctitle="The ${Name} API v${version}"
bottom="Copyright &#169; ${year} Jason Baldridge, Gann Bierner, Michael White and additional contributors. All Rights Reserved.">
<sourcepath>
<pathelement path="${src.dir}"/>
<pathelement path="${build.gen}"/>
</sourcepath>
<link href="http://docs.oracle.com/javase/6/docs/api/"/>
<link href="http://jgrapht.org/javadoc/"/>
<sourcepath>
<pathelement path="${src.dir}"/>
<pathelement path="${build.gen}"/>
</sourcepath>
<link href="http://docs.oracle.com/javase/6/docs/api/"/>
<link href="http://jgrapht.org/javadoc/"/>
<link href="http://www.jdom.org/docs/apidocs/"/>
</javadoc>
<subant antfile="${docs.dir}/build.xml" buildpath="${basedir}"/>
</javadoc>
<subant antfile="${docs.dir}/build.xml" buildpath="${basedir}"/>
</target>


Expand All @@ -245,17 +244,17 @@
<!-- =================================================================== -->
<target name="test" depends="compile">
<javac srcdir="${test.dir}" destdir="${build.dest}"
classpathref="build.classpath" debug="on" includeAntRuntime="false"/>
classpathref="build.classpath" debug="on" includeAntRuntime="false"/>

<junit haltonerror="true" fork="off" includeantruntime="false">
<classpath>
<pathelement location="${build.dest}"/>
<pathelement path="${java.class.path}"/>
<pathelement location="${lib.dir}/jdom.jar"/>
<pathelement location="${lib.dir}/jgrapht-jdk1.6.jar"/>
<pathelement location="${lib.dir}/junit-4.10.jar"/>
<pathelement location="${lib.dir}/serializer.jar"/>
<pathelement location="${lib.dir}/trove.jar"/>
<pathelement location="${lib.dir}/jdom.jar"/>
<pathelement location="${lib.dir}/jgrapht-jdk1.6.jar"/>
<pathelement location="${lib.dir}/junit-4.10.jar"/>
<pathelement location="${lib.dir}/serializer.jar"/>
<pathelement location="${lib.dir}/trove.jar"/>
</classpath>
<formatter type="plain" usefile="false" />
<batchtest>
Expand All @@ -270,21 +269,20 @@
<!-- =================================================================== -->
<!-- Cleans targets -->
<!-- =================================================================== -->
<target name="clean"
<target name="clean"
depends="init"
description="cleans up the directory">
<delete dir="${build.dir}"/>
<subant antfile="${src.dir}/ccg2xml/build.xml" buildpath="${basedir}"
target="clean"/>
target="clean"/>
<delete>
<fileset dir="${bin.dir}" includes="*.pyc"/>
</delete>
</target>

<target name="cleandocs" depends="init" description="cleans up the API docs directory, and extra pdf docs">
<delete dir="${build.javadocs}"/>
<subant antfile="${docs.dir}/build.xml" buildpath="${basedir}"
target="clean"/>
<subant antfile="${docs.dir}/build.xml" buildpath="${basedir}" target="clean"/>
</target>

</project>
Expand Down
Empty file modified src/ccg2xml/README
100755 → 100644
Empty file.
Loading