Skip to content

Commit

Permalink
kar validation now uses avro-specific kars
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Aug 11, 2024
1 parent a6db2a2 commit bfe117e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 7 additions & 9 deletions avro/core/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@ def fix_string_case(text: str) -> str:
return "".join(fixed)


# ASCII-specific validation functions.
# These are used for validating output while converting to ASCII after the initial conversion.
# Conversion-specific validation functions.
# These are only used for converting to and from ASCII characters.
def is_bangla_kar(char: str) -> bool:
"""
Check if given character is a Bengali kar.
"""
return char in config.AVRO_KAR


def is_bangla_prekar(char: str) -> bool:
Expand All @@ -88,13 +93,6 @@ def is_bangla_postkar(char: str) -> bool:
return char in config.BIJOY_POSTKAR


def is_bangla_kar(char: str) -> bool:
"""
Check if given character is a Bengali kar.
"""
return is_bangla_prekar(char) or is_bangla_postkar(char)


def is_bangla_banjonborno(char: str) -> bool:
"""
Check if given character is a Bengali banjonborno.
Expand Down
3 changes: 1 addition & 2 deletions avro/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from typing import Callable, Generator, List, Tuple, Union

# Import local modules.
from . import processor
from .core import validate
from .core import processor, validate
from .core.config import BIJOY_MAP, BIJOY_MAP_REVERSE


Expand Down

0 comments on commit bfe117e

Please sign in to comment.