摘要
分析了编程题的自动阅卷的现状及存在的不足。为了让计算机能够更加合理和有效地进行编程题的阅卷,提出了一种用正则表达式来分析程序代码,模拟人工阅卷的方法。介绍了此方法的原理和主要功能,给出了方法实现的具体步骤,对方法的关键部分如Java处理正则表达式的各个类以及方法的具体实施等都进行了详细的解释并举例进行了说明。其核心思想是利用正则表达式来抽象标准答案,再利用正则表达式强大的文本匹配功能来进行程序代码的分析,把不变的文本转化为具有一般性的表达式,大幅度增加了匹配的灵活性,从而达到简化阅卷的目的。
Analyzed the status quo and the shortages of auto- checking answer sheet of programs. In order to look over the examination papers by computer more reasonably and effectively, a method was given which used regular expressions to analyze the codes of program and simulate the artificial model. This paper also introduced the elements and chief function of the method, and the implementary process was given too;moreover,the pivotal parts of the method like the classes of Java that used to manage regular expressions and concretely actualizatiun of the method were explained amply and examples were additional. The central idea is to changeing for complicated standard solution to a series of regular expressions, and utiIize their powerful function in text matching to analyze the programming codes, thereby the aim of predigesting for lodking over answer papers is achieved,
出处
《计算机技术与发展》
2007年第7期244-246,共3页
Computer Technology and Development
关键词
正则表达式
抽象
文本匹配
regular expressions
abstract
text matching