markusleupold / bibtex-xml Goto Github PK
View Code? Open in Web Editor NEWExam project in the subject "Dokumentbeschreibungssprachen" of my study
Exam project in the subject "Dokumentbeschreibungssprachen" of my study
Scope: bibtoxml/src/BibTeX/Types.hs
In BibTeX, values can be concatenated to form a new value. BibTeX.Types supports this feature, but the implementation can be more precise: If you look closely, you will see that the set of all possible values forms a monoid together with the contatenation operation defined on it. Here's the proof:
Value
is the set of all possible values. Each element v of Value
has the data type Value
and is constructed using one of the three constructors LiteralValue
, ReferencedValue
, and ComposedValue
.
Also, we define the expansion operation e of a value:
e :: Value -> String
where e v
is the expanded string representation of v
(i.e. the meaning of v
as ordinary text, with variable references replaced by their definition recursively)
Third, we define the concatenation operation <+>
like following:
<+>: V x V --> V
where r = v1 <+> v2
is defined such that e r == e v1 ++ e v2
.
The Value
type in BibTeX.Types is not the actual value of a field. Semantically, a field's value is equal to the expansion of its Value
element. The internal representation of a field's value therefore has to simulate the semantics of its expansion. This means, that concatenating Value
elements is semantically equivalent to concatenating their expansions.
Because of that, Value
s inherit all characteristics from String
s which are based on the String
concatenation (++)
. String
s form a Monoid with their concatenation, and therefore also Value
s do, q.e.d.
It would be a good idea to adapt the Value
type according to Monoid laws and create a corresponding instance of Monoid. This will make the properties of Value
easier to see and understand and therefore improve code quality.
Scope: bibtoxml
Currently, bibtoxml only outputs BibTeX-XML documents without any DTD or XML-Schema. Command line options should be
provided to add a customizable XSD to the result document.
In the field name parsing functions there is a typo in the "chapter" field name: It is written as "chaper"
In a few gitignores, negated paths are only specified one level deep by using one asterisk. This only unignores the first level. To ignore all levels, we have to use a double asterisk !the/path/**
Scope: bibtoxml
Currently, bibtoxml only outputs BibTeX-XML documents without any DTD or XML-Schema. Command line options should be
provided to add a customizable DTD to the result document.
The mastersthesis entry type contains a typo: The 's' in the middle is missing in the BibTeX library. Took a bit of time to find this out :D
BibTeX's natural environment is TeX, and because of that, the values of a BibTeX database are very likely to contain TeX control sequences. Simple examples would be:
\"o
for the o umlaut\bf
for bold font text,,
for german opening quote marks (U+201E)It's clear, that these control sequences or active characters should be expanded when the user sees the end result. The question is, when the expansion should actually be done. There are three possibilities:
Scope: File bibtoxml/BibTeX/Parser.hs
Currently, the values are parsed using elements of type ValueParser
, which are tuples of
String
String
value into something of type Value
We can simplify this by specifying a single parser which combines the functions of elements one and two from above. This parser has type String -> Maybe (String, String)
. It will evaluate to Just
the raw value and the remaining input stream if it can be applied to the input stream and otherwise to Nothing
. Lazy evaluation will stop each parser as soon as it has been determined, that this parser ist not applicable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.