Docsity

An Introduction to Regular Expressions in Computational Linguistics - Prof. R. P. Malouf, Study notes of Linguistics

Partial preview of the text

Download An Introduction to Regular Expressions in Computational Linguistics - Prof. R. P. Malouf and more Study notes Linguistics in PDF only on Docsity!

An Extensible Regular Expression

Workbench

Rob Malouf

Department of Linguistics and Oriental Languages San Diego State University

Education Center on Computational Science and Engineering 15 December 2003

Computational linguistics

  • Computational linguists study automatic processing of human language
  • Descended from computer science and linguistics (plus philosophy, psychology, neuroscience, etc.)
  • As computational linguistics matures as a field, it has begun into influence related disciplines (bioinformatics, economics)
  • Computational linguistics program masters program offers a number of courses for undergraduates (LING 365, LING 571, LING 581)

Regular expressions

  • Regular expressions (REs) are one class of pattern description that is widely used in computational linguistics
  • Their origin is in the McCulloch-Pitts neuron (1943), formalized by Kleene (1951) and Rabin and Scott (1959)
  • Phonological and morphological rules can be written as REs
  • Syntactic rules can be usefully approximated as REs
  • Equivalent to finite state automata

Regular expressions

  • The simplest REs are just concatenations of symbols:

the big house

  • Symbols can be combined with disjunction :

(the|a|an) (big|white|old) (house|car)

  • Arbitrarily long sequences can be built up using iteration :

(the|a|an) (big|white|old)* (house|car)

Regular expressions

  • Teaching students to read, write, and process REs is a core part of the computational linguistics curriculum
  • REs are built up using a very simple syntax, but get complicated in a hurry:

(0[1-9]|[12][0-9]|3[01])- /.- /.\d\d

  • Some RE matching rules (backreferences, leftmost-longest-match) can be unintuitive
  • Corpus searching tools use REs, but don’t provide enough feedback

RE Workbench

  • Languages like perl and python allow more exploration, but require programming skills
  • The Regular Expression Workbench will provide students with a tool for learning about REs in a controlled environment:

http://edcenter2.sdsu.edu/RegExWB/input_page.htm

  • Next steps:

? polish user interface ? add on-line documentation ? show partial matches