Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve configuration setting and its customization #20

Open
zaemyung opened this issue Nov 16, 2021 · 0 comments
Open

Improve configuration setting and its customization #20

zaemyung opened this issue Nov 16, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@zaemyung
Copy link
Owner

  • Currently, the configuration of sentsplit is done via dicts in config.py.
  • And customizing the config setting is done as follows:
    from copy import deepcopy
    from sentsplit.config import ko_config
    from sentsplit.segment import SentSplit
    
    my_config = deepcopy(ko_config)
    my_config['segment_regexes'].append({'name': 'tilde_ending', 'regex': r'(?<=[다요])~+(?= )', 'at': 'end'})
    sent_splitter = SentSplit('ko', **my_config)
    
    sent_splitter.segment('안녕하세요~ 만나서 정말 반갑습니다~~ 잘 부탁드립니다!')
    
    # results with the regex: ['안녕하세요~', ' 만나서 정말 반갑습니다~~', ' 잘 부탁드립니다!']
    # results without the regex: ['안녕하세요~ 만나서 정말 반갑습니다~~ 잘 부탁드립니다!']
  • Improve config structure so that it facilitates easier customization and maintenance.
@zaemyung zaemyung added the enhancement New feature or request label Nov 16, 2021
@zaemyung zaemyung reopened this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants