Commit e24a1879 authored by Ulrich's avatar Ulrich

safing status

parent 1a043e14
...@@ -42,11 +42,13 @@ regex = "0.1" ...@@ -42,11 +42,13 @@ regex = "0.1"
time = "0.1" time = "0.1"
unidecode = "0.2.0" unidecode = "0.2.0"
fs_extra = "0.2.0" fs_extra = "0.2.0"
[dependencies.libxml] libxml = "0.0.746"
git = "https://github.com/jfschaefer/rust-libxml.git"
[dependencies.rust-senna] [dependencies.rust-senna]
git = "https://github.com/jfschaefer/rust-senna.git" git = "https://github.com/jfschaefer/rust-senna.git"
[dependencies.llamapun] [dependencies.llamapun]
git = "https://github.com/KWARC/llamapun.git" git = "https://github.com/KWARC/llamapun.git"
branch = "pattern_matcher" [dependencies.llamapun_adaption]
git = "https://github.com/urabenstein/llamapun.git"
branch = "experimentation"
...@@ -2,6 +2,7 @@ extern crate llamapun; ...@@ -2,6 +2,7 @@ extern crate llamapun;
extern crate libxml; extern crate libxml;
extern crate senna; extern crate senna;
extern crate spotter_lib; extern crate spotter_lib;
extern crate llamapun_adaption;
use std::fs; use std::fs;
use std::env; use std::env;
...@@ -13,6 +14,8 @@ use libxml::tree::*; ...@@ -13,6 +14,8 @@ use libxml::tree::*;
use libxml::parser::Parser; use libxml::parser::Parser;
use llamapun::data::Corpus; use llamapun::data::Corpus;
use llamapun::data::Document as lDoc; use llamapun::data::Document as lDoc;
use llamapun_adaption::pattern_example_adaption::get_declarations;
/* This adds scores to ambiguities of an annotation. The higher the score, the more likely the annotation. */ /* This adds scores to ambiguities of an annotation. The higher the score, the more likely the annotation. */
...@@ -89,6 +92,17 @@ pub fn read_document(s : &str, old_path : &Path, document_path : &Path, config : ...@@ -89,6 +92,17 @@ pub fn read_document(s : &str, old_path : &Path, document_path : &Path, config :
let orig_doc = opt_orig_doc.unwrap(); let orig_doc = opt_orig_doc.unwrap();
//call Frederiks program
let decl_vec = get_declarations(original_document.clone());
// for decl in decl_vec{
// println!("decl {}", decl);
// }
find_content(&root, &doc, &orig_doc, config); find_content(&root, &doc, &orig_doc, config);
doc.save_file(&s).unwrap(); doc.save_file(&s).unwrap();
} }
...@@ -149,7 +163,6 @@ fn find_content(node : &Node, annotation_document : &Document, original_document ...@@ -149,7 +163,6 @@ fn find_content(node : &Node, annotation_document : &Document, original_document
let mut first_node = vec[0].clone(); let mut first_node = vec[0].clone();
while let Some(parent) = first_node.get_parent(){ while let Some(parent) = first_node.get_parent(){
let class = parent.get_class_names();
if parent.get_name().eq("section") && parent.get_class_names().contains("ltx_bibliography"){ if parent.get_name().eq("section") && parent.get_class_names().contains("ltx_bibliography"){
opt_score = Some("-1.0"); opt_score = Some("-1.0");
break; break;
...@@ -359,4 +372,3 @@ pub fn add_meaning_for_as(qes : &Vec<SpottedQE>) -> Option<SpottedQE>{ ...@@ -359,4 +372,3 @@ pub fn add_meaning_for_as(qes : &Vec<SpottedQE>) -> Option<SpottedQE>{
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
& & \verb|{\rm ergsec}^{-1}{\rm cm}^{-2}$| & & & \verb|{\rm ergsec}^{-1}{\rm cm}^{-2}$| &
\cite{astro-ph/9211009} \\ \cite{astro-ph/9211009} \\
8 & $(0.4 \; \rm GeV)^2$ & \verb|$(0.4 \;\rm GeV)^2$| & \cite{hep-ph/9211221} \\ 8 & $(0.4 \; \rm GeV)^2$ & \verb|$(0.4 \;\rm GeV)^2$| & \cite{hep-ph/9211221} \\
9 & $10^{-34}{\rm gm/cm^{3}}$ & \verb|$10^{-34}{\rm gm/cm^{3}}$| & \cite{gr-qc/9211006} \\
\hline \hline
\end{tabular} \end{tabular}
\caption{Examples of the category of complex quantity \caption{Examples of the category of complex quantity
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment