Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaasonen committed Aug 21, 2018
1 parent 518cb6a commit 47a0291
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,47 @@
[![Maintainability](https://api.codeclimate.com/v1/badges/505e1372f12d2ec7eb0b/maintainability)](https://codeclimate.com/github/ElectronicBabylonianLiterature/fragment-hit-counter/maintainability)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

A script to extract fragments hits from a catalogue
The hit counter script extracts fragments hits from a catalogue. For each fragment in the catalogue the number of unique documents not starting with `BC` is calculated and saved to the database under `hits` property.

Usage:

```
node index.js <a path to the catalogue directory> <MongoDB URI> <MongoDB database>
```

The catalogue directory should contain "csv" files with the following format:

```
"Search Results"
"Summary"
"Saved on";"04.08.2018 17:45:55"
"Searched for";"K 6447"
"In index(es)";"X:\xxx\_OA\Indice\Index.pdx"
"Number of document(s) found";"5"
"Number of instance(s) found";"5"
"File name";"Title";"Page";"Search Instance"
"Fincke 2000 Augenleiden nach keilschriftlichen Quellen. Untersuchungen zur altorientalischen Medizin WMF 70.pdf";"";"185";"5 ......�........�.....�..... 178 K. 6447+7086+ ... cf. K. 2354+ ... K. 6461 Z. "
"File name";"Title";"Page";"Search Instance"
"Hee�el 2016 Medizinische Texte aus dem Alten Mesopotamien Translating Writings of Early Scholars.pdf";"";"14";"K. 3237 + K. 6447 + K. 7086 + K. 8356 + K. 8800 "
"File name";"Title";"Page";"Search Instance"
"Borger HKL 1 [1967].pdf";"";"282";"Ebeling KMI 45f.)+K 6447 C~;u~l.)+K 9828+K 11868(AMT 6/"
"File name";"Title";"Page";"Search Instance"
"Borger HKL 2 [1975].pdf";"";"162";"38) auch + K 6447 (von Thompson verwertet) + ~m 637 ("
"File name";"Title";"Page";"Search Instance"
"BC 2.pdf";"";"392";"sick people. [K. 6447] Portion out of the middle, 32in. by 31in.; . "
```

The fragment ID is parsed from the file name:
- `00XXX.csv` => `K.XXX`
- `YY 00XXXX.csv` => `YY.XXXX`
- `Rm 2 00XXXX.csv` => `Rm-II.XXXX`
- `Rm II 00XXXX.csv` => `Rm-II.XXXX`

If the file name does not match any pattern the file is ignored.

0 comments on commit 47a0291

Please sign in to comment.