智能邮件阅读
我正在开发一个 erp 系统,该系统是使用 Ruby on Rails 开发的。我想通过阅读电子邮件的内容来创建销售订单。我可以通过阅读内容来识别它是销售订单还是询价。
现在,我想阅读电子邮件并获取列表中的项目。我计划从电子邮件中提取单词并在项目下的数据库中搜索它们。我无法修复电子邮件的特定格式。
我将使用以下方法。 我将使用 ferret(最初可能会切换到 sphinx 或类似的)来搜索电子邮件内容中的项目。
1)。循环遍历项目表并搜索它们以查找精确的短语匹配。 Email.find_with_ferret("项目+名称")
2).在电子邮件中搜索项目名称拆分关键字。 Email.find_with_ferret("物品好听的名字")
3).模糊搜索 Email.find_with_ferret("items beautiful name~")
请帮助我改进这一点。
I am working on a erp system, being developed using Ruby on Rails. I want to create a sales order by reading the contents of the email. I can recognize by reading the contents if its a sales order or inquiry.
Now a step forward I want to read email and fetch the items in the list. I am planning to take words from the email and search them in the database under items. I can't fix a certain format for the email.
I am going to use following approach.
I'll be using ferret(initially, may switch to sphinx or similar) to search the items in the emails content.
1). Loop through items table and search them for exact phrase match.
Email.find_with_ferret("item+name")
2). Search email for item name split keyword. Email.find_with_ferret("items nice name")
3). Fuzzy search Email.find_with_ferret("items nice name~")
Please help me to improve this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将需要使用 Rails 拦截电子邮件。这是一篇不错的文章,解释了执行此操作的各种方法:
http://steve.dynedge.co.uk/2010/09/07/incoming-email-in-rails-3-choosing-the-right-approach/
You're going to need to intercept the emails with rails. Here's a decent article explaining the various approaches to doing this:
http://steve.dynedge.co.uk/2010/09/07/incoming-email-in-rails-3-choosing-the-right-approach/