@@ -5,20 +5,20 @@ The HSD format
55General description
66===================
77
8- You can think about the Human-readable Structured Data format as a pleasent
8+ You can think about the Human-readable Structured Data format as a pleasant
99representation of a tree structure. It can represent a subset of what you
10- can represent for example with XML. The following constraints with respect
10+ can do for example with XML. The following constraints compared
1111to XML apply:
1212
13- * Every node of a tree, which is not empty, can either contain further nodes
13+ * Every node of a tree, which is not empty, either contains further nodes
1414 or data, but never both.
1515
1616* Every node may have a single (string) attribute only.
1717
1818These constraints allow a very natural looking formatting of the data.
1919
20- As an example, let's have a look at a data tree, which represents the input
21- for a scientific software. In the XML representation, it could look as ::
20+ As an example, let's have a look at a data tree, which represents input
21+ for scientific software. In the XML representation, it could be written as ::
2222
2323 <Hamiltonian>
2424 <Dftb>
@@ -31,7 +31,7 @@ for a scientific software. In the XML representation, it could look as ::
3131 </Dftb>
3232 </Hamiltonian>
3333
34- The same information can be encoded much more natural and compact in the HSD
34+ The same information can be encoded in a much more natural and compact form in HSD
3535format as ::
3636
3737 Hamiltonian {
@@ -45,21 +45,21 @@ format as ::
4545 }
4646 }
4747
48- The content of a node can be passed either between an opening and a closing
49- curly brace or after an equal sign. In the latter case the end of the line will
48+ The content of a node are passed either between an opening and a closing
49+ curly brace or after an equals sign. In the latter case the end of the line will
5050be the closing delimiter. The attribute (typically the unit of the data
51- which a node contains) is specified between square brackets after
51+ which the node contains) is specified between square brackets after
5252the node name.
5353
54- The equal sign can not only be used to assign data as node content (provided
55- the data fits into one line), but also to assign a single child node as content
54+ The equals sign can be used to assign data as a node content (provided
55+ the data fits into one line), or to assign a single child node as content
5656for a given node. This leads to a compact and expressive notation for those
5757cases, where (by the semantics of the input) a given node is only allowed to
5858have a single child node as content. The tree above is a piece of a typical
5959DFTB+ input, where only one child node is allowed for the nodes ``Hamiltonian ``
60- and ``Filling ``, respectively. (They specify the type of the Hamiltonian
61- and the filling function.) By making use of equal signs, the
62- simplified HSD representation would look as compact as ::
60+ and ``Filling ``, respectively (They specify the type of the Hamiltonian
61+ and the filling function). By making use of equals signs, the
62+ simplified HSD representation can be as compact as ::
6363
6464 Hamiltonian = Dftb {
6565 Scc = Yes
@@ -76,7 +76,7 @@ Mapping to dictionaries
7676
7777Being basically a subset of XML, HSD data is best represented as an XML
7878DOM-tree. However, very often a dictionary representation is more desirable,
79- especially, when the language used to query and manipulate the tree offers
79+ especially when the language used to query and manipulate the tree offers
8080dictionaries as primary data type (e.g. Python). The data in an HSD input
8181can be easily represented with the help of nested dictionaries and lists. The
8282input from the previous section would have the following representation as
@@ -99,8 +99,8 @@ Python dictionary (or as a JSON formatted input file)::
9999The attribute of a node is stored under a special key containting the name of
100100the node and the ``.attrib `` suffix.
101101
102- One slight complication of the dictionary representation arrises in the case,
103- when a given node has multiple child nodes with the same name, such as ::
102+ One slight complication of the dictionary representation arises in the case
103+ of node which has multiple child nodes with the same name ::
104104
105105 <ExternalField>
106106 <PointCharges>
@@ -179,12 +179,12 @@ to record following additional data for each HSD node:
179179* the line, where the node was defined in the input (helpful for printing out
180180 informative error messages),
181181
182- * the name of the HSD node as found in the input (useful if the tag names are
182+ * the name of the HSD node, as found in the input (useful if the tag names are
183183 converted to lower case to ease case-insensitive handling of the input) and
184184
185- * whether an equal sign was used to open the block.
185+ * whether an equals sign was used to open the block.
186186
187- If those information are asked to be recored , a special key with the
187+ If this information is being recorded , a special key with the
188188``.hsdattrib `` suffix will be generated for each node in the dictionary/JSON
189189presentation. The correpsonding value will be a dictionary with those
190190information.
@@ -227,9 +227,9 @@ will yield the following dictionary representation of the input::
227227 }
228228
229229The recorded line numbers can be used to issue helpful error messages with
230- information about the line, where the user should search for the problem.
231- The node names and the formatting information about the equal sign can ensure,
232- that the formatting is similar to the original one , if the data is damped
230+ information about where the user should search for the problem.
231+ The node names and formatting information about the equal sign ensures
232+ that the formatting is similar to the original HSD , if the data is dumped
233233into the HSD format again. Dumping the dictionary with ::
234234
235235 hsd.dump(inpdict, "test2-formatted.hsd", use_hsd_attribs=True)
@@ -244,13 +244,13 @@ would indeed yield ::
244244 }
245245
246246which is basically identical with the original input. If the additional
247- processing information is not recorded when the data is loaded or
247+ processing information is not recorded when the data is loaded, or
248248it is not considered when the data is dumped as HSD again ::
249249
250250 inpdict = hsd.load("test.hsd", lower_tag_names=True)
251251 hsd.dump(inpdict, "test2-unformatted.hsd")
252252
253- the resulting formatting will differ from the original form more ::
253+ the resulting formatting will more strongly differ from the original HSD ::
254254
255255 hamiltonian {
256256 dftb {
0 commit comments