<commit_before># -*- coding: utf-8 -*-
"""
   smartformat.ext.korean
   ~~~~~~~~~~~~~~~~~~~~~~

   A SmartFormat extension for Korean.

   :copyright: (c) 2016 by What! Studio
   :license: BSD, see LICENSE for more details.

"""
import re

from smartformat import extension

from .hangul import is_hangul
from .particles import CombinableParticle, Euro, Ida, Particle


__all__ = ['ko']


#: Allomorphic Korean particles with the general rule.
PARTICLES = [
    # Simple allomorphic rule.
    Particle(u'은', u'는'),
    Particle(u'이', u'가'),
    Particle(u'을', u'를'),
    # Vocative particles.
    Particle(u'아', u'야'),
    Particle(u'이여', u'여'),
    Particle(u'이시여', u'시여'),
    CombinableParticle(u'과', u'와'),
    Euro,
]

#: Matches to particles which have no allomorphic rules.
INVARIANT_PARTICLE_PATTERN = re.compile(
    u'^([의도]$|만|보다|부터|까지|마저|마냥|조차|처럼|에|께|하고)'
)


patterns = []
_particles = {}
for x, p in enumerate(PARTICLES):<commit_msg>Add more invariant particles<commit_after># -*- coding: utf-8 -*-
"""
   smartformat.ext.korean
   ~~~~~~~~~~~~~~~~~~~~~~

   A SmartFormat extension for Korean.

   :copyright: (c) 2016 by What! Studio
   :license: BSD, see LICENSE for more details.

"""
import re

from smartformat import extension

from .hangul import is_hangul
from .particles import CombinableParticle, Euro, Ida, Particle


__all__ = ['ko']


#: Allomorphic Korean particles with the general rule.
PARTICLES = [
    # Simple allomorphic rule.
    Particle(u'은', u'는'),
    Particle(u'이', u'가'),
    Particle(u'을', u'를'),
    # Vocative particles.
    Particle(u'아', u'야'),
    Particle(u'이여', u'여'),
    Particle(u'이시여', u'시여'),
    CombinableParticle(u'과', u'와'),
    Euro,
]

#: Matches to particles which have no allomorphic rules.
INVARIANT_PARTICLE_PATTERN = re.compile(
    u'^([의도]$|만|보다|밖에|같이|부터|까지'
    u'|마저|마냥|조차|처럼|에|께|하고|뿐|대로)'
)


patterns = []
_particles = {}
for x, p in enumerate(PARTICLES):
{'fraction_non_alphanumeric': 0.17427385892116182, 'fraction_numerical': 0.005186721991701245, 'mean_word_length': 3.9083969465648853, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1759413', 'n_tokens_mistral': 774, 'n_tokens_neox': 802, 'n_words': 177}