mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-28 01:19:31 +00:00
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:
parent
3e454d7568
commit
ea3cd1ebba
@ -126,7 +126,7 @@ class RecursiveCharacterTextSplitter(TextSplitter):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_separators_for_language(language: Language) -> List[str]:
|
def get_separators_for_language(language: Language) -> List[str]:
|
||||||
if language == Language.CPP:
|
if language == Language.C or language == Language.CPP:
|
||||||
return [
|
return [
|
||||||
# Split along class definitions
|
# Split along class definitions
|
||||||
"\nclass ",
|
"\nclass ",
|
||||||
|
Loading…
Reference in New Issue
Block a user