dtvx3420 2016-10-06 13:39
浏览 48

是否有PHP或JS算法可以过滤掉字符串上的名词?

I was working on a forum and thought of making a tag generator, something like Quora.com but simpler. So, first I "purified" the string – meaning removed some irrelevant words like "for", "in"...

But I couldn't figure out how to only get the nouns in the string. For example: In this thread's title "Is there a PHP or JS algorithm that can filter out the nouns on a string?" would give us:

PHP
JS
algorithm
nouns
string

This is more or less good and accurate. But I also don't want to use a noun-list because I don't want to waste half of my years writing it. I'll also be glad if you know any good noun-lists. Thank you.

  • 写回答

1条回答 默认 最新

  • doulun0651 2016-10-06 14:13
    关注

    You need a "lexical dictionary" (dictionary that maintains metadata about words and connections between them) like Princeton Wordnet. This is an english word semantic database you can use to query and compare things like nouns / verbs or even synonyms / hypernyms.

    This obviously would run on your server. You would have to parse the strings on the server side (you could use Ajax if you want it to look like its on the client). There is no feasible way to maintain an entire english dictionary in browser memory, and to search through it, with anything resembling good performance.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起