Skip to content

Commit

Permalink
only sentence as boundary. no valid section. automatic deploy.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeekim committed Jul 11, 2017
1 parent f83272b commit f6305bf
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
18 changes: 16 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* import AssemblyKeys._
import sbt.complete.DefaultParsers._*/
import AssemblyKeys._
// import sbt.complete.DefaultParsers._

assemblySettings

Expand All @@ -11,6 +11,9 @@ libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.12.5" % "test"
scalacOptions in (Compile,doc) := Seq("-groups", "-implicits")
scalacOptions in Test ++= Seq("-Yrangepos")

name := "AnnotationFilter"
version := "0.2"

lazy val testERC = taskKey[Unit]("Prints 'ERC test results'")
testERC := {
"cat test/ercfunds.txt" #|
Expand Down Expand Up @@ -89,3 +92,14 @@ generateMP := {
"bin/mp.rb 2" #>
file("automata/mp.mwt") !
}

val deploy = TaskKey[Unit]("deploy", "Copies assembly jar to remote location")

deploy <<= assembly map { (asm) =>
val account = sys.env.get("ACCOUNT").getOrElse("")
val dpath = sys.env.get("DPATH").getOrElse("")
val local = asm.getPath
val remote = account + ":" + dpath + asm.getName
println(s"Copying: $local -> $account:$remote")
Seq("scp", local, remote) !!
}
6 changes: 3 additions & 3 deletions src/main/java/ukpmc/AnnotationFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ public void invoke(StringBuilder yytext, int start, DfaRun runner) {
String content = map.get(Xml.CONTENT);
String newoutput;

if ("TABLE".equals(map.get("type"))) {
/* if ("TABLE".equals(map.get("type"))) {
DfaRun dfaRunEntity = new DfaRun(dfa_entity);
dfaRunEntity.clientData = map.get("type");
newoutput = dfaRunEntity.filter(content);
} else if ("SENT".equals(map.get(Xml.TAGNAME))) {
} else */ if ("SENT".equals(map.get(Xml.TAGNAME))) {
DfaRun dfaRunPlain = new DfaRun(dfa_plain);
dfaRunPlain.clientData = map.get(Xml.TAGNAME);
newoutput = dfaRunPlain.filter(content);
Expand Down Expand Up @@ -279,7 +279,7 @@ private static boolean isOnlineValid(String db, String id, String domain) {
loadPredefinedResults();

Nfa bnfa = new Nfa(Nfa.NOTHING);
bnfa.or(Xml.GoofedElement("SecTag"), procBoundary)
bnfa // .or(Xml.GoofedElement("SecTag"), procBoundary)
.or(Xml.GoofedElement("SENT"), procBoundary);
dfa_boundary = bnfa.compile(DfaRun.UNMATCHED_COPY);

Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/validate.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ doiblacklist=doi.prefix.1000.tsv
# boundary=article
# boundary=text
# boundary=SENT|text|article
boundary=table|SENT
# boundary=SENT
# boundary=table|SENT
entity=z:[a-z]+
# entity=z:acc
15 changes: 10 additions & 5 deletions src/test/scala/Annotation_test.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class AnnotationSpec extends FlatSpec with Matchers {
"""<article><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="20" sec="">603878</z:acc></plain></SENT></text></article>""") should be (
"""<article><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" ids="603878">603878</z:acc></plain></SENT></text></article>""")
//
dfaRun.filter(
"""<SecTag type="TABLE"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="20" sec="">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="2000" sec="XXXX">603878</z:acc></plain></SENT></text></SecTag>""") should be (
"""<SecTag type="TABLE"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" ids="603878">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" ids="603878">603878</z:acc></plain></SENT></text></SecTag>""")
//dfaRun.filter(
// """<SecTag type="TABLE"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="20" sec="">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="2000" sec="XXXX">603878</z:acc></plain></SENT></text></SecTag>""") should be (
// """<SecTag type="TABLE"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" ids="603878">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" ids="603878">603878</z:acc></plain></SENT></text></SecTag>""")
//
dfaRun.filter(
"""<SecTag type="FIG"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="20" sec="">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="2000" sec="XXXX">603878</z:acc></plain></SENT></text></SecTag>""") should be (
Expand All @@ -31,9 +31,14 @@ class AnnotationSpec extends FlatSpec with Matchers {
"""<SENT sid="0" pm="."><plain>Research was supported by Finnish Academy (141069), ERC (ERC-2009-AdG-<z:acc db="erc" valmethod="context" domain="" context="(?i)(European Research Council|ERC grant|ERC advanced grant|ERC starting grant|ERC consolidator grant|ERC proof-of-concept grant|ERC-20[0-1][0-9]-)" wsize="60" sec="XXXX">250050</z:acc>, FutureGenes) grant, Sigrid Juselius Foundation, Finnish Foundation for Cardiovascular Research (all to S.Y.); the European Research Council (ERC-2010-AdG-<z:acc db="erc" valmethod="context" domain="" context="(?i)(European Research Council|ERC grant|ERC advanced grant|ERC starting grant|ERC consolidator grant|ERC proof-of-concept grant|ERC-20[0-1][0-9]-)" wsize="60" sec="XXXX">268804</z:acc>, VESSEL network), Leducq Transatlantic Network of Excellence on Lymph Vessels in Obesity and Cardiovascular Disease (11CVD03) (all to K.A.), a VENI fellowship of the Netherlands Organization of Scientific research (to J.C.S. 016.116.017); a PhD-student fellowship from the Cardiovascular Research Institute Maastricht (to T.L.T.) </plain></SENT>""") should be (
"""<SENT sid="0" pm="."><plain>Research was supported by Finnish Academy (141069), ERC (ERC-2009-AdG-<z:acc db="erc" ids="250050">250050</z:acc>, FutureGenes) grant, Sigrid Juselius Foundation, Finnish Foundation for Cardiovascular Research (all to S.Y.); the European Research Council (ERC-2010-AdG-<z:acc db="erc" ids="268804">268804</z:acc>, VESSEL network), Leducq Transatlantic Network of Excellence on Lymph Vessels in Obesity and Cardiovascular Disease (11CVD03) (all to K.A.), a VENI fellowship of the Netherlands Organization of Scientific research (to J.C.S. 016.116.017); a PhD-student fellowship from the Cardiovascular Research Institute Maastricht (to T.L.T.) </plain></SENT>""")
//
//dfaRun.filter(
// """<SecTag type="ACK"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="20" sec="ACK">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="2000" sec="ACK">603878</z:acc></plain></SENT></text></SecTag>""") should be (
// """<SecTag type="ACK"><text><SENT sid="34" pm="."><plain>omim 603878</plain></SENT><SENT sid="35" pm="."><plain>603878</plain></SENT></text></SecTag>""")
dfaRun.filter(
"""<SecTag type="ACK"><text><SENT sid="34" pm="."><plain>omim <z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="20" sec="ACK">603878</z:acc></plain></SENT><SENT sid="35" pm="."><plain><z:acc db="omim" valmethod="onlineWithContext" domain="omim" context="(?i)(o*mim)" wsize="2000" sec="ACK">603878</z:acc></plain></SENT></text></SecTag>""") should be (
"""<SecTag type="ACK"><text><SENT sid="34" pm="."><plain>omim 603878</plain></SENT><SENT sid="35" pm="."><plain>603878</plain></SENT></text></SecTag>""")
"""<SENT sid="1201668" pm="."><plain>Anti-M13K07 monoclonal antibody was purchased from Amersham Biosciences (Piscataway, NJ).Table 1.Antibody specificity.AntibodyProtein specificityReovirus strainT1LT3DT3SA+5C6T1 σ1+−−<z:acc db="pdb" valmethod="onlineWithContext" domain="pdbe" context="(?i)(pdb|(?:protein +data *bank))" wsize="20000" sec="">9BG5</z:acc>T3 σ1−++8H6T1 and T3 μ1+++4F2T3D σ3−+− </plain></SENT>""") should be (
"""<SENT sid="1201668" pm="."><plain>Anti-M13K07 monoclonal antibody was purchased from Amersham Biosciences (Piscataway, NJ).Table 1.Antibody specificity.AntibodyProtein specificityReovirus strainT1LT3DT3SA+5C6T1 σ1+−−9BG5T3 σ1−++8H6T1 and T3 μ1+++4F2T3D σ3−+− </plain></SENT>"""

)
}
// <z:acc db="omim" ids="603878-603890">603878 to 603890</z:acc>
}

0 comments on commit f6305bf

Please sign in to comment.