Skip to content

Commit

Permalink
Merge branch 'unicode-11'
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinlindstam committed Jun 10, 2018
2 parents 931fa2b + 13a0d90 commit b008ab9
Show file tree
Hide file tree
Showing 14 changed files with 4,268 additions and 3,080 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ target/

# OS X
.DS_Store

# Other
.python-version
.pytest_cache
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
install:
- "pip install coveralls"
- "pip install -e .[test]"
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 0.4.0
Added support for Unicode 11.

Added `grapheme.UNICODE_VERSION`.

No other API changes

## 0.3.0
Added a few new functions:

* `grapheme.safe_split_index`, which can find the highest grapheme boundary index in a given string without traversing the full grapheme sequence.
* `grapheme.startswith`, which tests that a given string starts with the same grapheme sequence as a given prefix.
* `grapheme.endswith`, which tests that a given string ends with the same grapheme sequence as a given suffix.

## 0.2.1
Performance improvements

No new functionality, but noticably better performance.

## 0.2.0
* Adds `grapheme.contains`
* Bugfix for empty strings

## 0.1.0
Initial release

Basic support for getting graphemes, grapheme string lengths and grapheme based slicing.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ groups (graphemes) as defined by the `Unicode Standard Annex #29 <http://unicode
pip install grapheme
The currently supported version of Unicode: 11.0.0

What? Why?
==========

Expand Down
10 changes: 8 additions & 2 deletions grapheme/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
"""
Main module for the grapheme package.
.. data:: UNICODE_VERSION
The currently supported Unicode version
"""

from .api import graphemes, length, grapheme_lengths, slice, contains, safe_split_index, startswith, endswith
from .api import (graphemes, length, grapheme_lengths, slice, contains, safe_split_index, startswith, endswith,
UNICODE_VERSION)

__all__ = ['graphemes', 'length', 'grapheme_lengths', 'slice', 'contains', 'safe_split_index', 'startswith', 'endswith']
__all__ = ['graphemes', 'length', 'grapheme_lengths', 'slice', 'contains', 'safe_split_index', 'startswith', 'endswith',
'UNICODE_VERSION']
4 changes: 4 additions & 0 deletions grapheme/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-
from grapheme.finder import GraphemeIterator, get_last_certain_break_index


UNICODE_VERSION = "11.0.0"


def graphemes(string):
"""
Returns an iterator of all graphemes of given string.
Expand Down
Loading

0 comments on commit b008ab9

Please sign in to comment.