<commit_before>ocr-correction
==============

OCR correction in browser for Leiden Hackathon


## CORS for CouchDB

<pre>curl -X PUT http://127.0.0.1:5984/_config/httpd/enable_cors -d '"true"'
curl -X PUT http://127.0.0.1:5984/_config/cors/origins -d '"*"'
curl -X PUT http://127.0.0.1:5984/_config/cors/credentials -d '"true"'
curl -X PUT http://127.0.0.1:5984/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT http://127.0.0.1:5984/_config/cors/headers -d '"accept, authorization, content-type, origin"'</pre>

Then restart CouchDB.

## URLs for page image and XML

http://biostor.org/bhl_page_xml.php?PageID=34570741
http://biostor.org/bhl_page_bw_image.php?PageID=34570741<commit_msg>Information on CouchDB<commit_after>ocr-correction
==============

OCR correction in browser for Leiden Hackathon

## Setting up CouchDB

### CORS for CouchDB

<pre>curl -X PUT http://127.0.0.1:5984/_config/httpd/enable_cors -d '"true"'
curl -X PUT http://127.0.0.1:5984/_config/cors/origins -d '"*"'
curl -X PUT http://127.0.0.1:5984/_config/cors/credentials -d '"true"'
curl -X PUT http://127.0.0.1:5984/_config/cors/methods -d '"GET, PUT, POST, HEAD, DELETE"'
curl -X PUT http://127.0.0.1:5984/_config/cors/headers -d '"accept, authorization, content-type, origin"'</pre>

Then restart CouchDB.

### Create database and view

Create database called "ocr", then create the view page/edits:

```javascript
function(doc) {
  emit([doc.pageId, doc.time, doc.lineId], doc.text);
}
```


## URLs for page image and XML

http://biostor.org/bhl_page_xml.php?PageID=34570741
http://biostor.org/bhl_page_bw_image.php?PageID=34570741
{'fraction_non_alphanumeric': 0.18321078431372548, 'fraction_numerical': 0.08088235294117647, 'mean_word_length': 4.354098360655738, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6656282', 'n_tokens_mistral': 733, 'n_tokens_neox': 638, 'n_words': 139}