Commit 0625eed9 authored by Ulrich's avatar Ulrich

more text

parent e24a1879
......@@ -86,7 +86,7 @@ pub fn tokenize_help(dom : &DOM, para : &Node, final_delimiter : &Vec<&str>, int
}
let wnode = new_child(word_id, &para_id, &dom, &format!("{}",char));
word_id += 1;
para.add_child(&wnode).unwrap();
para.add_child(wnode).unwrap();
// 1. if part is not empty, analyze part and add the corres. spans
// 2. add a new span with this char as content
......@@ -102,25 +102,25 @@ pub fn tokenize_help(dom : &DOM, para : &Node, final_delimiter : &Vec<&str>, int
} else if child.get_name().eq("span") && !child.get_class_names().contains("word"){
tokenize_help(dom, &child, final_delimiter, intermediate_delimiter, None);
child.unlink();
para.add_child(&child).unwrap();
para.add_child(child).unwrap();
//new_para.add_child(&child).unwrap();
}else if child.get_name().eq("math"){
child.unlink();
para.add_child(&child).unwrap();
para.add_child(child).unwrap();
let wnode : Node = Node::new("span", None, &dom).unwrap();
wnode.add_property("class", "word");
wnode.set_content(" ");
para.add_child(&wnode).unwrap();
para.add_child(wnode).unwrap();
}else{
child.unlink();
para.add_child(&child).unwrap();
para.add_child(child).unwrap();
// new_para.add_child(&child).unwrap();
}
}
}
pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, para_id : &str, final_delimiter : &Vec<&str>, intermediate_delimiter : &Vec<&str>) -> i32{
pub fn analyze_part(part : &str, mut word_id : i32, para : &mut Node, dom : &DOM, para_id : &str, final_delimiter : &Vec<&str>, intermediate_delimiter : &Vec<&str>) -> i32{
let mut new_content = part.to_string();
let mut ends_with_del = Vec::new();
let mut starts_with_del = Vec::new();
......@@ -153,7 +153,7 @@ pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, pa
for d in starts_with_del{
let wnode = new_child(word_id, para_id, &dom, &d);
word_id += 1;
para.add_child(&wnode).unwrap();
para.add_child(wnode).unwrap();
}
// if ends_with_del.len() == 0{
......@@ -176,20 +176,20 @@ pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, pa
if digits.len() > 0 {
let wnode0 = new_child(word_id, para_id, &dom, &digits);
word_id += 1;
para.add_child(&wnode0).unwrap();
para.add_child(wnode0).unwrap();
digits = String::new();
}
if last < byte {
let wnode1 = new_child(word_id, para_id, &dom, &escape_for_xml(&new_content[last..byte]));
word_id += 1;
para.add_child(&wnode1).unwrap();
para.add_child(wnode1).unwrap();
}
// println!("second {}\n", &c_str);
let wnode2 = new_child(word_id, para_id, &dom, &c_str);
word_id += 1;
para.add_child(&wnode2).unwrap();
para.add_child(wnode2).unwrap();
last = byte + char.len_utf8();
}else if char.is_digit(10) || char.eq(&'.') || char.eq(&','){
digits.push(char);
......@@ -197,7 +197,7 @@ pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, pa
if byte > last{
let wnode1 = new_child(word_id, para_id, &dom, &escape_for_xml(&new_content[last..byte]));
word_id += 1;
para.add_child(&wnode1).unwrap();
para.add_child(wnode1).unwrap();
}
last = byte + char.len_utf8();
......@@ -205,7 +205,7 @@ pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, pa
}else if digits.len() > 0{
let wnode0 = new_child(word_id, para_id, &dom, &digits);
word_id += 1;
para.add_child(&wnode0).unwrap();
para.add_child(wnode0).unwrap();
digits = String::new();
last = byte;
}
......@@ -214,13 +214,13 @@ pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, pa
if digits.len() > 0 {
let wnode0 = new_child(word_id, para_id, &dom, &digits);
word_id += 1;
para.add_child(&wnode0).unwrap();
para.add_child(wnode0).unwrap();
}
if last < len {
let wnode = new_child(word_id, para_id, &dom, &escape_for_xml(&new_content[last..]));
word_id += 1;
para.add_child(&wnode).unwrap();
para.add_child(wnode).unwrap();
}
for i in 0..ends_with_del.len(){
......@@ -235,17 +235,17 @@ pub fn analyze_part(part : &str, mut word_id : i32, para : &Node, dom : &DOM, pa
let wnode = new_child(word_id, para_id, &dom, &content);
word_id += 1;
para.add_child(&wnode).unwrap();
para.add_child(wnode).unwrap();
}
return word_id;
}
pub fn new_child(word_id : i32, para_id : &str, dom : &DOM, content : &str) -> Node{
let wnode : Node = Node::new("span", None, &dom).unwrap();
wnode.add_property("class", "word");
let mut wnode : Node = Node::new("span", None, &dom).unwrap();
wnode.set_property("class", "word");
// wnode.add_property("style", "color:red");
wnode.add_property("id", &format!("{}.w{}", para_id, word_id));
wnode.set_property("id", &format!("{}.w{}", para_id, word_id));
wnode.set_content(content);
return wnode;
}
......
......@@ -13,7 +13,7 @@
\cite{physics/9807021} \\
5 & 0.45 eV & 0.45 eV & \cite{cond-mat/9807211}\\
6 & 200 $\mu$m & 200 \verb|$\mu$|m & \cite{cond-mat/9807012} \\
7 & $R = 25$M$\Omega$ & \verb|$R=25$|M\verb|$\Omega$| &
7 & $25$M$\Omega$ & \verb|$25$|M\verb|$\Omega$| &
\cite{cond-mat/9807012} \\
8 & $0.6M_\odot$ & \verb|$0.6M_\odot$|
& \cite{astro-ph/9807152} \\
......@@ -61,8 +61,8 @@
3 & $4.8\times 10^{9}$ cm${}^{-2}$ &
\verb|$4.8\times 10^{9}$| cm\verb|${}^{-2}$| &
\cite{cond-mat/9807235} \\
4 & $\gamma = 0.5$ eV/Å${}^{3}$ &
\verb|$\gamma = 0.5$| eV/Å\verb|${}^{3}$| &
4 & $0.5$ eV/Å${}^{3}$ &
\verb|$0.5$| eV/Å\verb|${}^{3}$| &
\cite{cond-mat/9807211} \\
5 & $100$ km s${}^{-1}$ Mpc${}^{-1}$ &
\verb|$100$| km s\verb|${}^{-1}$| Mpc\verb|${}^{-1}$|
......
......@@ -177,15 +177,47 @@ Erlangen, \today
\section{Introduction}
\subsection{Motivation}
The first detected human measurements were done at least 30,000 years ago~\cite{haustein2001weltchronik}.
Since then many different physical quantities evolved, ranging from old human-based quantities -- like feet
and cubit -- to modern scientific quantities -- for example light years and electron masses.
Imperial and metric units are well-known examples of different systems of measurement.
Their mixture already caused expensive errors like the crash of the Mars Climate Orbiter, where one team
worked with imperial units while another one used metric units~\cite{marsorbiter}.
The quantification of the environment is an essential part of human life and
%It is necessary for comparisons
%and therefore the requirement for barter trade.
it is thus not surprising that the first detected human measurements were done at least 30,000 years ago~\cite{haustein2001weltchronik}\ednote{Give a concrete example of such a measurement}.\ednote{describe the meaning of
measurement in this case}.
In former times, length, for instance, was measured in comparison to the human body, like in the case
of the units feet and cubit. Without a fixed value for these terms, we can regard the information that, for
instance, a house
has a height of 10 feet only as a loose estimate. The exact value depends on the length of the compared foot, which
is obviously impractical as a common system.
This problem can be solved by defining exact values for the terms.
Like this, we get fixed \textit{units} -- like the modern unit feet as a measure for length.
However different units with different values arose in different societies.
Today there are two predominant systems of measurement, the imperial system and the metric system.
Nowadays the latter is officially accepted in nearly all countries, but the former is still in use in many
countries of the former British Empire.
The mixture of both systems already caused expensive errors like the crash of the
Mars Climate Orbiter~\cite{marsorbiter} in 1999. It happened because a part of the program calculated the impulse
of the spacecraft in imperial units, namely in pound-seconds, while a different module expected the impulse
in Newton-seconds -- a metric unit -- as an input. The miscalculation lead to a wrong
position of the spacecraft that finally caused the crash.
Efforts for a uniform system of measurement resulted in the International System of Units (abbreviated as SI) which
was resolved in 1960~\cite{ptbsi}. It is based on the seven units meter, kilogram, second, ampere,
kelvin, mol and candela and also contains many derived units, for instance watt and ohm.
was resolved in 1960~\cite{ptbsi}. It is based on the seven basic units meter, kilogram, second, ampere,
kelvin, mol and candela. For convenience, the system also contains many units that can be derived from the
basic units. For instance Watt, a unit for power, is defined in terms of basic units as
$1 \; \rm W = 1 \; \rm kg \cdot \rm m^2 \cdot \rm s^{-3}$ and Ohm, a unit for electrical resistance, is defined as
$1 \; \rm \Omega = 1 \; \rm W \cdot \rm A^{-2} = 1 \; \rm kg \cdot \rm m^2 \cdot \rm s^{-3} \cdot \rm A^{-2}$.
% Subsequently there is an interest to standardize the value of units, which resulted in
% the International System of Units (abbreviated as SI) which
% was resolved in 1960~\cite{ptbsi}.
%
% Since then many different physical quantities evolved, ranging from old human-based quantities -- like feet
% and cubit -- to modern scientific quantities -- for example light years and electron masses.
%
% Imperial and metric units are well-known examples of different systems of measurement.
% Their mixture already caused expensive errors like the crash of the Mars Climate Orbiter, where one team
% worked with imperial units while another one used metric units~\cite{marsorbiter}.
It is based on the seven units
Nevertheless, many different and often specialized units are still used, like solar masses in astronomy and
electron volt in high energy physics.
Semantic services can simplify the work with quantity expressions and units and this thesis thus provides a framework
......
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