community[minor]: added support for C in RecursiveCharacterTextSplitter (#24091)

Description: Added support for C in RecursiveCharacterTextSplitter by
reusing the separators for C++
This commit is contained in:
Harley Gross 2024-07-11 12:47:48 -04:00 committed by GitHub
parent 3e454d7568
commit ea3cd1ebba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,7 +126,7 @@ class RecursiveCharacterTextSplitter(TextSplitter):
@staticmethod
def get_separators_for_language(language: Language) -> List[str]:
if language == Language.CPP:
if language == Language.C or language == Language.CPP:
return [
# Split along class definitions
"\nclass ",