Skip to content

noora-ekramy/wordNet-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Word-Net Problem

Algorithm Project
Faculty of Computer and Information Sciences - Ain Shams University


Description

Read this PDF for description and problem definition :

https://drive.google.com/drive/folders/1qbO0qFh09IFlg1AH0a0PUiFu8DWzpP6F

Used Data Structure

  • To store information of “synsets” file :
  1. A Dictionary “Words” with a string as a key denoting the word, and a list of integers referring to synsets to which the key string belongs. The Dictionary generic class provides a mapping from a set of keys to a set of values. Each addition to the dictionary consists of a value and its associated key. Retrieving a value by using its key is very fast, close to O (1) because the Dictionary class is implemented as a hash table. If Count is less than the capacity, this method approaches an O (1) operation. If the capacity must be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count. “Words” helped us to map nouns to synsets in no time.

  2. List of List of strings “Synsets” to keep the words belonging to each synset and it takes time O (1) to be accessed. “Synsets” helped with mapping synsets to nouns in no time.

  • To store information of “hypernyms” file:
  1. List of List of integers “Graph” holding data of each synset, and its root and it takes time O (1) to be accessed. “Graph” helped with the Shortest Common Ancestor (SCA) algorithm.

Analysis

❖ Efficient Distance And SCA between Two Synsets IDs :

The total Complexity is O(m) where m is the number of the synsets in the way to root from the current two synsets (as shown in the graph below). The Complexity of calculating SCA and Distance between two nouns using this algorithm will be O(ABm) where A and B are the number of synsets that each noun belongs to.

❖ Efficient Distance and SCA between Two Nouns :

The same Algorithm is used to calculate the SCA for two synsets, the difference is in the initialization step, however, this algorithm takes less time to calculate the Distance and SCA between two nouns than the Efficient SCA. The total Complexity is O(m + A*B) where m is the number of the synsets in the way to root from all the synsets used synsets, and (A, B) are the number of synsets that each noun belongs to.

In each line of the code, there is a comment of its complexity.

Contributors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages