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

various fintan things #72

Draft
wants to merge 18 commits into
base: fintan-support
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 42 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Expand All @@ -31,7 +32,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.0</version>
<version>5.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -53,10 +54,9 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
<version>1.5.0</version>
<scope>compile</scope>
</dependency>
<!--
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-arq</artifactId>
Expand All @@ -67,21 +67,15 @@
<artifactId>jena-core</artifactId>
<version>3.6.0</version>
</dependency>
-->
<dependency>
<groupId>org.acoli.fintan</groupId>
<artifactId>fintan-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.3</version>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
Expand All @@ -91,18 +85,6 @@
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-bom</artifactId>
<version>2.16.0</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
Expand All @@ -125,6 +107,43 @@
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>generate-code-coverage-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/org/acoli/conll/rdf/ANSI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.acoli.conll.rdf;

public enum ANSI {
;

public static final String RESET = "\u001B[0m";
public static final String BRIGHTER = "\u001B[1m";
public static final String ULINE = "\u001B[4m";
public static final String FLASH = "\u001B[5m";
public static final String BLACK = "\u001B[30m";
public static final String RED = "\u001B[31m";
public static final String GREEN = "\u001B[32m";
public static final String YELLOW = "\u001B[33m";
public static final String BLUE = "\u001B[34m";
public static final String PURPLE = "\u001B[35m";
public static final String CYAN = "\u001B[36m";
public static final String WHITE = "\u001B[37m";
public static final String BLACK_BK = "\u001B[40m";
public static final String RED_BK = "\u001B[41m";
public static final String GREEN_BK = "\u001B[42m";
public static final String YLW_BK = "\u001B[43m";
public static final String BLUE_BK = "\u001B[44m";
public static final String PPL_BK = "\u001B[45m";
public static final String CYAN_BK = "\u001B[46m";
public static final String WHITE_BK = "\u001B[47m";
}
16 changes: 8 additions & 8 deletions src/main/java/org/acoli/conll/rdf/CoNLLRDFAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,19 @@ public static void main(String[] args) throws IOException {
while(!command.trim().equals(">")) {
System.err.print(
"actions ............................................................................................................\n"+
" : "+ANSI_BLUE+"$nr/$att=$val"+ANSI_RESET+" for element number $nr, set CoNLL property $att to $val, e.g., \"1/POS=NOUN\" :\n"+
" : "+ANSI.BLUE+"$nr/$att=$val"+ANSI.RESET+" for element number $nr, set CoNLL property $att to $val, e.g., \"1/POS=NOUN\" :\n"+
//" : $nr element number (starting with 1), e.g., 1 for the first :\n"+
//" : $att local name of a CoNLL property, e.g., POS :\n"+
//" : $val string value of the CoNLL property, e.g., NOUN :\n"+
" : for HEAD, enter the number of the head node, will be expanded to URI :\n"+
" : "+ANSI_BLUE+"$nr/$p1[/$p2..]"+ANSI_RESET+" multiple $att=$val patterns $p1, $p2, ... for $nr can be provided as ,-separated list :\n"+
" : "+ANSI.BLUE+"$nr/$p1[/$p2..]"+ANSI.RESET+" multiple $att=$val patterns $p1, $p2, ... for $nr can be provided as ,-separated list :\n"+
" : e.g., \"1/HEAD=0/EDGE=root\"; NOTE: $val must not contain / :\n"+
" : "+ANSI_BLUE+">"+ANSI_RESET+" write and go to next sentence :\n"+
" : "+ANSI_BLUE+"m"+ANSI_RESET+" define or undefine a macro (a regex for preprocessing your input) :\n"+
" : "+ANSI_BLUE+"<CTRL>+C"+ANSI_RESET+" quit :\n"+
" : "+ANSI.BLUE+">"+ANSI.RESET+" write and go to next sentence :\n"+
" : "+ANSI.BLUE+"m"+ANSI.RESET+" define or undefine a macro (a regex for preprocessing your input) :\n"+
" : "+ANSI.BLUE+"<CTRL>+C"+ANSI.RESET+" quit :\n"+
" :..........................................................................................................:\n");
if(macros.trim().length()>0)
System.err.println("macros "+ANSI_RED+macros.replaceAll("\n",ANSI_RESET+"\n "+ANSI_RED).replaceAll("\t","\t"+ANSI_RESET+"=>\t"+ANSI_BLUE)+ANSI_RESET);
System.err.println("macros "+ANSI.RED+macros.replaceAll("\n",ANSI.RESET+"\n "+ANSI.RED).replaceAll("\t","\t"+ANSI.RESET+"=>\t"+ANSI.BLUE)+ANSI.RESET);
System.err.print("| ----------------------------\n| "+CoNLLRDFFormatter.extractCoNLLGraph(buffer,true).replaceAll("\n","\n| ")+"-----------------------------\n"+
"command: ");
command=commands.readLine().trim();
Expand Down Expand Up @@ -107,7 +107,7 @@ public static void main(String[] args) throws IOException {
}
command = "";
}
//System.err.println(ANSI_RED+"> "+line+ANSI_RESET);
//System.err.println(ANSI.RED+"> "+line+ANSI.RESET);
if(line.trim().startsWith("@") && !lastLine.trim().endsWith("."))
//System.out.print("\n");
buffer=buffer+"\n";
Expand Down Expand Up @@ -140,7 +140,7 @@ protected static String applyMacros(String macros, String cmd) {
cmd=cmd.replaceAll(lhs,rhs);
}
if(!cmd.equals(orig))
System.err.println("macro expansion: "+ANSI_RED+orig+ANSI_RESET+"\t=>\t"+ANSI_BLUE+cmd+ANSI_RESET);
System.err.println("macro expansion: "+ANSI.RED+orig+ANSI.RESET+"\t=>\t"+ANSI.BLUE+cmd+ANSI.RESET);
return cmd;
}

Expand Down
Loading