RecursiveCharacterTextSplitter.from_language(    language=Language.JS, chunk_size=60, chunk_overlap=0)result = js_splitter.split_documents(docs)len(result)    7print("\n\n--8<--\n\n".join([document.page_content for document in result]))    class MyClass {      constructor(name) {        this.name = name;        --8<--        }        --8<--        greet() {        console.log(`Hello, ${this.name}!`);      }    }        --8<--        function main() {      const name = prompt("Enter your name:");        --8<--        const obj = new MyClass(name);      obj.greet();    }        --8<--        // Code for: class MyClass {        // Code for: function main() {        --8<--        main();PreviousSnowflakeNextSpreedlySplittingCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
This notebook covers how to load source code files using a special approach with language parsing: each top-level function and class in the code is loaded into separate documents. Any remaining code top-level code outside the already loaded functions and classes will be loaded into a separate document.
This notebook covers how to load source code files using a special approach with language parsing: each top-level function and class in the code is loaded into separate documents. Any remaining code top-level code outside the already loaded functions and classes will be loaded into a separate document. ->: RecursiveCharacterTextSplitter.from_language(    language=Language.JS, chunk_size=60, chunk_overlap=0)result = js_splitter.split_documents(docs)len(result)    7print("\n\n--8<--\n\n".join([document.page_content for document in result]))    class MyClass {      constructor(name) {        this.name = name;        --8<--        }        --8<--        greet() {        console.log(`Hello, ${this.name}!`);      }    }        --8<--        function main() {      const name = prompt("Enter your name:");        --8<--        const obj = new MyClass(name);      obj.greet();    }        --8<--        // Code for: class MyClass {        // Code for: function main() {        --8<--        main();PreviousSnowflakeNextSpreedlySplittingCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.