add add_file function to load text from file
add a handy function to load local text file (for example if you own several contents locally) instead of 2 step: load file then use add_local to pass as local strings
@1MikeMakuch its a different thing
the add_file accept file path instead of pass string directly,
after file loaded/content ready,
it allow to pass text to use textLoader load content (can refer the readme in the PR)
@gasolin Ah yes. I'm using this PR now. Thanks.
Hey, the idea is good, but the implementation is in a different style. Please don't make it a method of the main class. Please add a loader and chunker, the loader can internally use the text loader.
@cachho : should this be a separate data type? like txt file?
@cachho : should this be a separate data type? like
txtfile?
this abstracts two lines of code. Two lines of code that would allow important customization like adding line by line or the whole text at once. So it's up to you how much abstraction you want to add, I don't think we need it.
But you are right, if we add it it has to be it's own datatype. Maybe you could even do txt_file_lines and txt_file to deal with the customization I mentioned.
can you open an issue to add a new data loader called "txt".
can close this PR if not needed.
opened #417 to implement this the right way. closing this.