Metadata-Version: 2.1
Name: cqls
Version: 0.1.6
Summary: A parser for an often-used subset of Corpus Query Language
Home-page: http://github.com/liao961120/cqls
Author: Yongfu Liao
Author-email: liao961120@github.com
License: MIT
Description: ![Support Python Version](https://img.shields.io/badge/python-%E2%89%A5%203.7-blue.svg)
        
        # Corpus Query Langauge Subset
        
        Parse Corpus Query Language into a list of queries in JSON format.
        
        
        ## Installation
        
        ```bash
        pip install cqls
        ```
        
        
        ## Usage
        
        ```python
        >>> import cqls
        >>> cql = '''
        ... "我" [pos="V."]+
        ... '''
        >>> cqls.parse(cql, default_attr="word", max_quant=5)
        [
          [{'match': {'word': ['我']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}], 
          [{'match': {'word': ['我']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}], 
          [{'match': {'word': ['我']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}], 
          [{'match': {'word': ['我']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}], 
          [{'match': {'word': ['我']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}, {'match': {'pos': ['V.']}, 'not_match': {}}]
        ]
        ```
        
        
        ## Supported CQL features
        
        - token: `[]`, `"我"`, `[word="我"]`, `[word!="我" & pos="N.*"]`
        - token-level quantifier: `+`, `*`, `?`, `{n,m}`
        - grouping: `("a" "b"? "c"){1,2}`
        - label: `lab1:[word="我" & pos="N.*"] lab2:("a" "b")`
Platform: UNKNOWN
Description-Content-Type: text/markdown
