Professional Documents
Culture Documents
Theory
The objective of understanding the morphology of a word through the use of
an Add-Delete table is to explore how words can be transformed by adding or
deleting letters. This experiment aims to demonstrate the principles of
morphological operations, which are fundamental in understanding how
words are formed and modified in natural languages.
Morphology is the study of the structure of words and how they are formed
from smaller meaningful units called morphemes. Morphological operations
include:
table = []
# Add operation
for i in range(len(word) + 1):
for char in 'abcdefghijklmnopqrstuvwxyz':
new_word = word[:i] + char + word[i:]
table.append((f"ADD {char}", new_word))
# Delete operation
for i in range(len(word)):
new_word = word[:i] + word[i + 1:]
table.append((f"DEL {word[i]}", new_word))
return table
def print_add_delete_table(word):
"""
Print the Add-Delete table for a given word.
"""
table = generate_add_delete_table(word)
print(f"Add-Delete Table for '{word}':")
for operation, new_word in table:
print(f"{operation}: {new_word}")
# Example word
word = "example"
This code defines two functions for generating and printing an Add-Delete
table for a given word. Here's a breakdown of each function:
print_add_delete_table(word) :
This function takes a word as input and prints the
Add-Delete table for that word. It calls generate_add_delete_table(word) to
generate the table and then iterates over each tuple in the table to print the
operation and the corresponding new word.
ADD a: aexample
ADD b: bexample
ADD c: cexample
ADD d: dexample
ADD e: eexample
ADD f: fexample
ADD g: gexample
ADD h: hexample
ADD i: iexample
ADD j: jexample
ADD k: kexample
ADD l: lexample
ADD m: mexample
ADD n: nexample
ADD o: oexample
ADD p: pexample
ADD q: qexample
ADD r: rexample
ADD s: sexample
ADD t: texample
ADD u: uexample
ADD v: vexample
ADD w: wexample
ADD x: xexample
ADD y: yexample
ADD z: zexample
DEL e: xample
DEL x: eample
DEL a: exmple
DEL m: exaple
DEL p: examle
DEL l: exaple
DEL e: exampl