Class: Langchain::Processors::Eml
- Defined in:
- lib/langchain/processors/eml.rb
Constant Summary collapse
- EXTENSIONS =
[".eml"]
- CONTENT_TYPES =
["message/rfc822"]
Instance Method Summary collapse
-
#initialize ⇒ Eml
constructor
A new instance of Eml.
-
#parse(data) ⇒ String
Parse the document and return the cleaned text.
Methods included from DependencyHelper
Constructor Details
#initialize ⇒ Eml
Returns a new instance of Eml.
9 10 11 |
# File 'lib/langchain/processors/eml.rb', line 9 def initialize(*) depends_on "mail" end |
Instance Method Details
#parse(data) ⇒ String
Parse the document and return the cleaned text
16 17 18 19 20 |
# File 'lib/langchain/processors/eml.rb', line 16 def parse(data) mail = Mail.read(data.path) text_content = extract_text_content(mail) clean_content(text_content) end |