Lex和Yacc程序 [英] Lex and Yacc Programs

查看:89
本文介绍了Lex和Yacc程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编写Lex and Yacc程序以检查名词是否可数??



帮帮我...




谢谢

How to write a Lex and Yacc Program to check whether noun is countable or not??



Help me ...




Thanks

推荐答案

无论您使用什么程序,都只能用一种方法来实现:通过有一个大词典来指示每篇文章中的某些语法和语义类别.这个词本身不包含任何信息.此外,在阅读文章中的信息之前,您需要首先将每个单词分类为名词还是不分类,或者用字典分类,您需要确定哪种可能的 homonyms ( ^ ]).如果不分析上下文,这通常是不可能的(反过来,这是一个非常困难的问题,在当前的计算机科学和技术水平上,这不能以令人满意的质量解决),并且对于某些文本根本无法解决.例如,在单词游戏中通常使用同音异义词,因此甚至可能不会假设人类读者对单词含义的最终解决方案.

您没有解释您的意思是什么语言,但是对于某些语言,甚至不存在可数性类别,或者无法建立名词分为可数和不可数的名词,或者没有任何意义.

总体而言,这个问题没有太大意义,并且与Lex或Yacc基本上无关.

—SA
No matter what programs are you using, you can do it in only one way: by having a big dictionary which indicates some grammar and semantic categories in each article. The word itself carries no information on what is it. Moreover, before reading the information from the article, you need first classify each word as a noun or not, or with a dictionary, you need to decide which of the possible homonyms (http://en.wikipedia.org/wiki/Homonym[^]) should be considered. This is often impossible without analysis of the context (which is, in turn, a very difficult problem which is not solved with satisfactory quality on the present level of computer science and technology), and cannot be solves at all for certain texts. For example, the use of homonyms is typical for wordplay, so the final resolution of the meaning of the word by a human reader may be not even assumed.

You did not explain which languages do you mean, but for certain language the category of countability does not even exist or classification of nouns into countable and non-countable cannot be built or makes no sense.

Overall, the question does not make a whole lot of sense and not essentially related to Lex or Yacc.

—SA


这篇关于Lex和Yacc程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆