[texhax] Little Languages and diaries

William F Hammond hmwlfsr at yahoo.com
Sat May 19 21:30:30 CEST 2018


Mike Marchywka <marchywka at hotmail.com> writes:

> I'm not entirely sure what little languages are but I have
> been using tex to create a diet diary that I later need to
> parse and graph.  There is no money involved but vitamins
> coudl just as easily be money...

> So, I have to be consistent about my nominally free form
> entries. I enter them into a tex table rather than a csv
> file since that is my primary "lab notebook" document.  I
> ended up picking a simple adjective-noun restriction, a
> simple macro syntax and wrote c++ code to parse it but was
> curious if there is a general solution somewhere.

> This has worked well compared to taking each day's meal
> notes and trying to use a GUI to put them into a DB and
> then get them back out etc. The c++ parse picks up entry
> errors as well as a GUI and has other benefits.  In theory
> I could enter them into a cell phone in the kitchen but I
> just use "vi" on a laptop. I think I asked about this on
> some other forum but got no responses.

Since I have not seen an example of what you want to
process, this response may be off point.

When you say "general solution", I take that to suggest a
library (for C++, Java, Python, or whatever) which organizes
the task of writing the code to parse.  In that direction I
would be inclined to think about (1) translating the source
into your own custom SGML document type, (2) morphing that
in a more or less canonical way to an XML shadow document
type, and then (3) using one of the XML libraries for your
favorite language to reach the desired end format.

Depending on the nature of your source, it might be easily
possible to go directly from that to an XML document type.

                              -- Bill

Email: hmwlfsr chez yahoo
   or: gellmu chez gmail
https://www.facebook.com/william.f.hammond
http://www.albany.edu/~hammond/



More information about the texhax mailing list