主权项 |
1. A counting device for counting input sentences, comprising:
an input part for inputting a first sentence and a second sentence; a syntax analyzing part for generating a syntax tree of the first sentence and a syntax tree of the second sentence by accomplishing syntax analysis on the first sentence and the second sentence; a subtree generating part for generating one or multiple first subtrees that are subtrees comprising the first sentence, from the generated syntax tree of the first sentence, and generating one or multiple second subtrees that are subtrees comprising the second sentence, from the generated syntax tree of the second sentence; a match determination part for determining whether or not a first expression represented by a first subtree comprising a subtree combination and a second expression represented by a second subtree comprising the subtree combination represent matching content, for one or multiple subtree combinations that are combinations or any one of the one or multiple first subtrees generated and one or multiple of the second subtrees generated; a categorizing part for categorizing a first subtree representing a first expression and a second subtree representing a second expression into the same group for one combination of the first expression and the second expression determined to be representing matching content, or respective multiple combinations of the first expression and the second expression determined to be representing matching content; and, an output part for outputting the number of subtrees categorized into the group, or an expression respectively represented by one subtree or multiple subtrees categorized into the group. |