Skip to content

Commit

Permalink
Merge pull request #4 from Yossi/patch-1
Browse files Browse the repository at this point in the history
explicitly open file as utf8
  • Loading branch information
chaimleib authored Apr 3, 2018
2 parents 9b719fd + 71f2db8 commit ee4e543
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ In addition, sometimes single-letter numerals are spelled out in full. For such
2. Use a YAML library to load `hebrew-special-numbers/styles/default.yml` into an associative array. For example, in Python (with the `pyyaml` package installed):
```python
import yaml
hsn = yaml.load(open('hebrew-special-numbers/styles/default.yml'))
hsn = yaml.load(open('hebrew-special-numbers/styles/default.yml', encoding="utf8"))
```

3. Optional: It is possible to create styles by cascading styles on top of each other. Load in any additional styles and recursively merge them into your associative array. This may require defining a recursive `merge` function.
```python
# using merge() by Andrew Cooke, http://stackoverflow.com/a/7205107
chaipower = yaml.load(open('hebrew-special-numbers/styles/chaipower.yml'))
chaipower = yaml.load(open('hebrew-special-numbers/styles/chaipower.yml', encoding="utf8"))
hsn = merge(hsn, chaipower)
```

Expand Down
2 changes: 1 addition & 1 deletion test/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from os import path
import yaml # requires `pip install pyyaml`
proj_dir = path.dirname(path.dirname(path.realpath(__file__)))
hsn = yaml.load(open(path.join(proj_dir, 'styles/default.yml')))
hsn = yaml.load(open(path.join(proj_dir, 'styles/default.yml'), encoding="utf8"))


def hebrew_numeral(val, gershayim=True):
Expand Down

0 comments on commit ee4e543

Please sign in to comment.