You are on page 1of 5

Objective

The Objective of the experiment is understanding the morphology of a word


by the use of Add-Delete table.

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:

Affixation: Adding prefixes or suffixes to a word to change its meaning or


grammatical function. For example, adding "un-" to "happy" to form
"unhappy."

Inflection: Adding inflectional endings to indicate grammatical features such


as tense, number, or gender. For example, adding "-s" to "dog" to form "dogs"
for plural.

Derivation: Adding derivational affixes to create new words or change the


lexical category of a word. For example, adding "-ness" to "kind" to form
"kindness.

Compounding: Combining two or more words to create a new word with a


combined meaning. For example, "blackboard" is formed by combining
"black" and "board."

Reduplication: Repeating all or part of a word to indicate a related meaning.


For example, "bye-bye" or "mishmash."

The Add-Delete table experiment focuses on two basic morphological


operations: adding a letter (Add) and deleting a letter (Delete). By
systematically applying these operations to a given word, the table
demonstrates how different forms of the word can be generated, providing
insight into the internal structure and morphological processes of the
language.
Code
def generate_add_delete_table(word):
"""
Generate an Add-Delete table for a given word.
Each row represents a transformation from the original word
to a new word by adding or deleting a single letter.
"""

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"

# Generate and print the Add-Delete table


print_add_delete_table(word)
Explanation of code

This code defines two functions for generating and printing an Add-Delete
table for a given word. Here's a breakdown of each function:

This function takes a word as input and generates


generate_add_delete_table(word) :
an Add-Delete table for that word. It iterates over the length of the word,
adding each letter of the alphabet to every possible position in the word
(including at the beginning and end) to simulate the "ADD" operation. It also
iterates over each letter of the word to create new words by deleting each
letter, simulating the "DELETE" operation. The function returns a list of tuples,
where each tuple contains an operation (either "ADD" or "DELETE") and the
resulting new word.

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.

For the example word "example", the output of print_add_delete_table(word) will


be an Add-Delete table showing all possible transformations of the word
"example" by adding or deleting a single letter. The output has been provided
in a previous response.
OUTPUT

Add-Delete Table for 'example':

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

You might also like