8
Is there any service that does the recognition if a certain type of word is a preposition?
I want to make a word ranking of a rss feeder, but ignoring prepositions.
Ignoring words with less than N characters is a good start, but it may not be enough, because there are still large prepositions. Follow two lists:
Essential prepositions: a, before, after, until, with, against, since, in, between, to, per, before, without, under, over, behind.
Accidental prepositions of: as (= as), as (= as per), as per (= as per), as per (= as per), as per (= as per) during, except as per, outside, as per, as per, as per, except as per (= per).
Do you know any service that does this identification or have any idea of how to implement a reasonable method, that is, it does not need to be 100% comprehensive, but it does cover a significant part of the words?
It can be in any language.
Thank you.
It follows an excerpt of C# code that I’m using in the prototype, but which has proved inefficient:
private static IEnumerable<IGrouping<string, string>> MostCommonWords(string str, int maxNumWords)
{
var prepositions = new string[] {/*...*/};
var mostCommonWords =
Regex.Split(str.ToLower(), @"\W+")
.Where(s => s.Length > 3 && !prepositions.Contains(s))
.GroupBy(s => s)
.OrderByDescending(g => g.Count()).Take(maxNumWords);
return mostCommonWords;
}
Why so many negative votes??
– André Ribeiro
"This question shows no research effort; it is not clear or not useful". He didn’t research the subject, he just asked "Do you do it for me? Or are you ready?".
– mutlei
No, I disagree, the question is an indication of a method to do something, he is not asking anyone to hand over the program, besides he did an analysis of the possibilities, effort != code
– Isvaldo Fernandes
@At no time did he ask "do for me". He asks if there is already something ready to do that or if there is some reasonable method of implementation, which is totally valid. The question is well written and objective.
– André Ribeiro