mirror of https://github.com/hwchase17/langchain
community[patch]: avoid KeyError when language not in LANGUAGE_SEGMENTERS (#15212)
**Description:** Handle unsupported languages in same way as when none is provided **Issue:** The following line will throw a KeyError if the language is not supported. ```python self.Segmenter = LANGUAGE_SEGMENTERS[language] ``` E.g. when using `Language.CPP` we would get `KeyError: <Language.CPP: 'cpp'>` --------- Co-authored-by: Bagatur <baskaryan@gmail.com>pull/16494/head
parent
3f38e1a457
commit
b3ed98dec0
Loading…
Reference in New Issue