diff --git a/pythainlp/util/phoneme.py b/pythainlp/util/phoneme.py index 08d642031..ec5277119 100644 --- a/pythainlp/util/phoneme.py +++ b/pythainlp/util/phoneme.py @@ -125,7 +125,13 @@ def nectec_to_ipa(pronunciation: str) -> str: "d":"d", "f":"f", "h":"h", - "j":"y", + # The conversion of j depends on its position in the syllable. + # But, unfortunately, the current implementation cannot handle both cases. + # To remove confusions without changing the behavior and breaking existing codes, + # it is suggested that the first key-value mapping of j be simply commented out, + # as it would be overridden by the second one and thus never take effect from the beginning. + # See #846 for a more detailed discussion: https://github.com/PyThaiNLP/pythainlp/issues/846 + # "j":"y", "k":"k", "kĘ°":"kh", "l":"l", @@ -198,7 +204,7 @@ def ipa_to_rtgs(ipa: str) -> str: Docs: https://en.wikipedia.org/wiki/Help:IPA/Thai :param str ipa: IPA phoneme - :return: The RTGS that is converted + :return: The RTGS that is converted, according to rules listed in the Wikipedia page :rtype: str :Example: