You are on page 1of 3

‫جامعـة العلـوم التطبيقية الخاصة‬ APPLIED SCIENCE UNIVERSITY (ASU)

‫كلية تكنولوجيا المعلومات‬ FACULTY OF INFORMATION


2-2019 ‫الواجب األول‬
TECHNOLOGY (FIT)
FIRST ASSIGNMENT 2019-2

Subject: Natural language processing


Due on
Student Name: 7097544
June 31, 2020
Student ID: Instructor: Dr.Mahmoud Al-Bashayrah
Please note that this homework is 3 pages and with a total of 10 points.
Question 1: [1 point]
Write regular expressions for the following languages. You may use regexpal tool for
testing.

A. [1 POINT] The set of all lower-case alphabetic strings ending in the letter b.
[a-z]*b

Question 2: [1 point]
Write regular expressions for the following languages. By “word”, we mean an alphabetic
string separated from other words by whitespace, any relevant punctuation, line breaks,
and so forth. You may use regexpal tool for testing.

A. [1 POINT] All strings that start at the beginning of the line with an integer and that
end at the end of the line with a word.
^\d+b.*\b[a-zA-Z] +$

© 2019-2020 Faculty of Information Technology (FIT), Applied Science Private University, Amman, Jordan. 1
Question 3: [3 points]
Compute the edit distance (using insertion cost 1, deletion cost 1, substitution cost 1) of
“leda” to “deal”. Show your work (using the edit distance grid).

Target 
l a e d #
Source 
4 3 2 1 0 #
3 3 2 1 1 l
1 2 1 2 2 e
1 2 1 2 3 d
0 1 1 3 4 a

Minimum edit distance = 0

© 2019-2020 Faculty of Information Technology (FIT), Applied Science Private University, Amman, Jordan. 2
Question 4: [5 points]
Use the algorithm of minimum edit distance with backtrace to output the alignment to
convert "beauty" to "buy" with minimum edit distance. Show your work (using the
minimum edit distance with backtrace grid).

Target 
y u b #
Source 
<3 <2 <1 0 #
2 1 \0 ^1 b
2 2 1 ^2 e
3 3 2 ^3 a
4 3 3 ^4 u
5 4 4 ^5 t
5 5 5 ^6 y

Minimum edit distance =

The alignment based on backtrace:5

GOOD LUCK

© 2019-2020 Faculty of Information Technology (FIT), Applied Science Private University, Amman, Jordan. 3

You might also like