diff options
Diffstat (limited to 'mammoth/style_reader')
| -rw-r--r-- | mammoth/style_reader/__init__.py | 1 | ||||
| -rw-r--r-- | mammoth/style_reader/document_matcher_reader.py | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/mammoth/style_reader/__init__.py b/mammoth/style_reader/__init__.py index 892326e..705abff 100644 --- a/mammoth/style_reader/__init__.py +++ b/mammoth/style_reader/__init__.py @@ -1 +1,2 @@ from .html_path_reader import read_html_path +from .document_matcher_reader import read_document_matcher diff --git a/mammoth/style_reader/document_matcher_reader.py b/mammoth/style_reader/document_matcher_reader.py new file mode 100644 index 0000000..583613a --- /dev/null +++ b/mammoth/style_reader/document_matcher_reader.py @@ -0,0 +1,19 @@ +from parsimonious.grammar import Grammar + +from .. import document_matchers + + +def read_document_matcher(string): + paragraph_node = _grammar.parse(string) + return _read_paragraph_node(paragraph_node) + + + +def _read_paragraph_node(paragraph_node): + return document_matchers.paragraph() + + +_grammar = Grammar(r""" +paragraph = "p" +""") + |
