SlideShare a Scribd company logo
Data Structures & Algorithms
Project Title:
Dictionary Implementation Using TRIE
Problem Statement
 Through our project we intend to help our user to
find the meaning, synonyms, antonyms and examples
of an entered word and if the user enters invalid
word then we help them to explore more words
similar to the entered word.
 User can find translation of the entered word, also
view the search history and also know ‘word of the
day’ which enables the user to learn a new word
every day.
Algorithm Description
 getnode()
Description: This function returns the address of the newnode.
Method: Allocate space to temporary variable temp and set all its alphabet node
to NULL.Return temp.
 printHistory()
Description: This function prints the history of searched words.
Method: Open the history file in read mode and read all the words one by one and
display it
 addHistory(key)
Description: This function adds a word in the history file.
Method: Open the history file in write mode and write the contents of key to it.
 insert(root,key)
Description: This function inserts a word in TRIE.
Method: Access the TRIE from the root and set all the nodes (which come in the
key) to TRUE and when the end of the word is reached then store the key in the
fname field.
 search(root,key)
Description: This function searches for a key in TRIE.
Method: Search each character level by level and if a specific character at a
certain level does not exist then return false which means that the word does not
exist . If all the characters exist then return TRUE.
 insert_word(key)
Description: This function inserts a new word in the Dictionary.
Method: Store the word in TRIE.Store the meaning and description of the word in
a file whose name is the word stored in key.
 printData(key)
Description: This function prints data from file name stored in key variable.
Method: Open the file (whose name is stored in key field) and access all the
characters and print them.
 search_similar(root,key)
Description: This function prints word similar to the word stored in key variable.
Method: Access the TRIE from the root and if even if one of the letter in key
variable doesn’t exist then the corresponding existing variable is accessed and the
similar word is found.If none of the corresponding variable exist then print “The
word doesn’t exist.”
 wordRead(filename,choice)
Description: This function prints the French word or Spanish word of a given
word.
Method: Ask the user to enter a word.Open the file(filename contains the name
of the file) and search all the records one by one if the word entered by the user is
found then the corresponding French or Spanish word is printed based on the
choice of the user.
 wordOfTheDay(root)
Description: This function prints the word of the day.
Method: Randomly generate any number and fetch the word from that location of
the file(words.txt) and store it in file t_date and print the description of the word.
Why did we use TRIE?
 A Dictionary can also be implemented using other concepts
(e.g. HASH TABLES).
 Searching for data in a TRIE is faster.
 free from collision.
 no need to choose a hash function.
 predetermined alphabetical ordering.
 find words with common prefix.
 Time Complexity:
 We can search the key in O(M) time; M is length of the
string.
 Space Complexity:
 Memory requirements of TRIE is O(ALPHABET_SIZE *
key length * N) where N is number of keys in TRIE.
Features of Project
1. Find meaning, description, synonyms,
antonyms and examples of the entered word.
2. Insert new word in dictionary.
3. Find Similar words of the entered word.
4. Know ‘word of the day’.
5. Find translation of the entered word (English)
in French & Spanish.
6. View search history.
Input Output Screen Shots
 Searching for a word  Similar words
 Inserting a word & then searching for it
 Finding translation
 Word of the day
Advantages
 All in One!!
 We have made an application which not only a simple dictionary which
tells you the meaning of the entered word but also it tells you the whole
description, synonyms, antonyms and practical use of that word in a
sentence.
 Even this is not the only feature but we created another application of Word
Translation in this only which gives us the translation of entered word in
either French or in Spanish
 It provides Word of the Day which means every day our code will generate a
random word from its memory and will give all the data related to it. One
can learn at least a new word in a day and can increase his/her vocabulary
using our application.
 Our application can correct a wrong word as well. So in spite of displaying
“Word not Found” like in case of many other dictionaries ,ours gives you
Suggestions
 Currently we have just 50-55 words in our dictionary but at any point of
time one can Add a new Words in the Dictionary by first entering Password
for the Safety.
 We are also providing List of Frequently Searched Words. So to decrease the
time complexity if the searched word is one of the Frequently searched word
then our code will directly print the data of that file and if not than first
traverse the TRIE than print the data.
Disadvantages
 Add New Word: While we do provide the functionality to add new words
into the dictionary, though there is an inherent flaw in it - the person
might enter any arbitrary sequence of characters (which the 'Trie '
identifies as a word).
 For example - the person might enter 'asdfg' as a
word into the file. Our program cannot distinguish between an arbitrary
sequence of characters and a valid English word.
 This basically implies that the software can be easily
corrupted.
 Deletion of a word: It can only be done by explicitly opening the text file
containing the data and then deleting it.
 Memory Consumption: Due to our lack of knowledge and time as well we
have not implemented Word Scraping. So currently we are storing each
data in Text File which consumes more memory but if we had used word
scraping then our code might not be using any amount of memory.
 Less Words : Though at any point of time one can Add new Words in our
Dictionary but currently we have just 50-55 words in our dictionary
 Search Incorrectly Spelled Word: We do have implemented an algorithm in
which similar words to the incorrect word entered are shown to the user,
but have not implemented anything which corrects the words which are
spelled incorrectly.
Real World Application of TRIE
 Auto complete in web searching
 Spell checker (Auto correct)
 Word game
 Dictionary
 Longest prefix matching
 Translator
 Criminology
 Phone book search
Thank You…!! 

More Related Content

What's hot

PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
Rashid Ahmad
 
Enums in c
Enums in cEnums in c
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instruction
DeepikaT13
 
Micro operations
Micro operationsMicro operations
Micro operations
Ramakrishna Reddy Bijjam
 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Rabin BK
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
Arpana shree
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
Harshit Jaysan Sharma
 
Computer instruction
Computer instructionComputer instruction
Computer instruction
Sanjeev Patel
 
Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation SystemPriyanka Sharma
 
Displacement addressing
Displacement addressingDisplacement addressing
Displacement addressing
Rajon
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
Jyothishmathi Institute of Technology and Science Karimnagar
 
Phone Book project in Data Structure C
Phone  Book  project in Data Structure CPhone  Book  project in Data Structure C
Phone Book project in Data Structure C
VaithekyAnandarajah
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
Vasim Pathan
 
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Jayanshu Gundaniya
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
Shuvongkor Barman
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10chidabdu
 
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdfSTRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
系統程式 -- 第 3 章
系統程式 -- 第 3 章系統程式 -- 第 3 章
系統程式 -- 第 3 章
鍾誠 陳鍾誠
 

What's hot (20)

PHP LICTURES ..........
PHP LICTURES ..........PHP LICTURES ..........
PHP LICTURES ..........
 
Enums in c
Enums in cEnums in c
Enums in c
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
memory reference instruction
memory reference instructionmemory reference instruction
memory reference instruction
 
Micro operations
Micro operationsMicro operations
Micro operations
 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
Enumerated data types in C
Enumerated data types in CEnumerated data types in C
Enumerated data types in C
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
Computer instruction
Computer instructionComputer instruction
Computer instruction
 
Presentation on Railway Reservation System
Presentation on Railway Reservation SystemPresentation on Railway Reservation System
Presentation on Railway Reservation System
 
Displacement addressing
Displacement addressingDisplacement addressing
Displacement addressing
 
Compiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent OptimizationsCompiler Design- Machine Independent Optimizations
Compiler Design- Machine Independent Optimizations
 
Phone Book project in Data Structure C
Phone  Book  project in Data Structure CPhone  Book  project in Data Structure C
Phone Book project in Data Structure C
 
Spr ch-02
Spr ch-02Spr ch-02
Spr ch-02
 
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
Basics of pointer, pointer expressions, pointer to pointer and pointer in fun...
 
Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)Presentation on Breadth First Search (BFS)
Presentation on Breadth First Search (BFS)
 
Algorithm chapter 10
Algorithm chapter 10Algorithm chapter 10
Algorithm chapter 10
 
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdfSTRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
STRUCTURE AND UNION IN C MRS.SOWMYA JYOTHI.pdf
 
系統程式 -- 第 3 章
系統程式 -- 第 3 章系統程式 -- 第 3 章
系統程式 -- 第 3 章
 

Similar to Dictionary implementation using TRIE

Full text search
Full text searchFull text search
Full text searchdeleteman
 
Souvenir's Booth - Algorithm Design and Analysis Project Project Report
Souvenir's Booth - Algorithm Design and Analysis Project Project ReportSouvenir's Booth - Algorithm Design and Analysis Project Project Report
Souvenir's Booth - Algorithm Design and Analysis Project Project Report
Akshit Arora
 
MACHINE-DRIVEN TEXT ANALYSIS
MACHINE-DRIVEN TEXT ANALYSISMACHINE-DRIVEN TEXT ANALYSIS
MACHINE-DRIVEN TEXT ANALYSIS
Massimo Schenone
 
An Extensible Multilingual Open Source Lemmatizer
An Extensible Multilingual Open Source LemmatizerAn Extensible Multilingual Open Source Lemmatizer
An Extensible Multilingual Open Source Lemmatizer
COMRADES project
 
Stemming is one of several text normalization techniques that converts raw te...
Stemming is one of several text normalization techniques that converts raw te...Stemming is one of several text normalization techniques that converts raw te...
Stemming is one of several text normalization techniques that converts raw te...
NALESVPMEngg
 
python full notes data types string and tuple
python full notes data types string and tuplepython full notes data types string and tuple
python full notes data types string and tuple
SukhpreetSingh519414
 
Boolean operators
Boolean operatorsBoolean operators
Boolean operators
Dean Da Costa
 
The Ring programming language version 1.5.4 book - Part 178 of 185
The Ring programming language version 1.5.4 book - Part 178 of 185The Ring programming language version 1.5.4 book - Part 178 of 185
The Ring programming language version 1.5.4 book - Part 178 of 185
Mahmoud Samir Fayed
 
This program here prints the number of words that occurs in the inpu.pdf
This program here prints the number of words that occurs in the inpu.pdfThis program here prints the number of words that occurs in the inpu.pdf
This program here prints the number of words that occurs in the inpu.pdf
shanki7
 
Parser
ParserParser
"the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar."the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar.
Vladimir Ulogov
 
The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181
Mahmoud Samir Fayed
 
Unsupervised Software-Specific Morphological Forms Inference from Informal Di...
Unsupervised Software-Specific Morphological Forms Inference from Informal Di...Unsupervised Software-Specific Morphological Forms Inference from Informal Di...
Unsupervised Software-Specific Morphological Forms Inference from Informal Di...
Chunyang Chen
 
EasyChair-Preprint-7375.pdf
EasyChair-Preprint-7375.pdfEasyChair-Preprint-7375.pdf
EasyChair-Preprint-7375.pdf
NohaGhoweil
 
Haystack 2018 - Algorithmic Extraction of Keywords Concepts and Vocabularies
Haystack 2018 - Algorithmic Extraction of Keywords Concepts and VocabulariesHaystack 2018 - Algorithmic Extraction of Keywords Concepts and Vocabularies
Haystack 2018 - Algorithmic Extraction of Keywords Concepts and Vocabularies
Max Irwin
 
Sentence analysis
Sentence analysisSentence analysis
Sentence analysiskrukob9
 
GPT for polyglots and language learners.pptx
GPT for polyglots and language learners.pptxGPT for polyglots and language learners.pptx
GPT for polyglots and language learners.pptx
Alexander Galkin
 
An Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding SystemAn Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding System
inscit2006
 
Clean code lecture part I
Clean code lecture part IClean code lecture part I
Clean code lecture part I
Jun Shimizu
 

Similar to Dictionary implementation using TRIE (20)

Full text search
Full text searchFull text search
Full text search
 
Souvenir's Booth - Algorithm Design and Analysis Project Project Report
Souvenir's Booth - Algorithm Design and Analysis Project Project ReportSouvenir's Booth - Algorithm Design and Analysis Project Project Report
Souvenir's Booth - Algorithm Design and Analysis Project Project Report
 
MACHINE-DRIVEN TEXT ANALYSIS
MACHINE-DRIVEN TEXT ANALYSISMACHINE-DRIVEN TEXT ANALYSIS
MACHINE-DRIVEN TEXT ANALYSIS
 
An Extensible Multilingual Open Source Lemmatizer
An Extensible Multilingual Open Source LemmatizerAn Extensible Multilingual Open Source Lemmatizer
An Extensible Multilingual Open Source Lemmatizer
 
Stemming is one of several text normalization techniques that converts raw te...
Stemming is one of several text normalization techniques that converts raw te...Stemming is one of several text normalization techniques that converts raw te...
Stemming is one of several text normalization techniques that converts raw te...
 
python full notes data types string and tuple
python full notes data types string and tuplepython full notes data types string and tuple
python full notes data types string and tuple
 
Boolean operators
Boolean operatorsBoolean operators
Boolean operators
 
The Ring programming language version 1.5.4 book - Part 178 of 185
The Ring programming language version 1.5.4 book - Part 178 of 185The Ring programming language version 1.5.4 book - Part 178 of 185
The Ring programming language version 1.5.4 book - Part 178 of 185
 
This program here prints the number of words that occurs in the inpu.pdf
This program here prints the number of words that occurs in the inpu.pdfThis program here prints the number of words that occurs in the inpu.pdf
This program here prints the number of words that occurs in the inpu.pdf
 
Parser
ParserParser
Parser
 
"the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar."the Bund" language. A PEG grammar.
"the Bund" language. A PEG grammar.
 
The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181The Ring programming language version 1.5.2 book - Part 174 of 181
The Ring programming language version 1.5.2 book - Part 174 of 181
 
Unsupervised Software-Specific Morphological Forms Inference from Informal Di...
Unsupervised Software-Specific Morphological Forms Inference from Informal Di...Unsupervised Software-Specific Morphological Forms Inference from Informal Di...
Unsupervised Software-Specific Morphological Forms Inference from Informal Di...
 
EasyChair-Preprint-7375.pdf
EasyChair-Preprint-7375.pdfEasyChair-Preprint-7375.pdf
EasyChair-Preprint-7375.pdf
 
Haystack 2018 - Algorithmic Extraction of Keywords Concepts and Vocabularies
Haystack 2018 - Algorithmic Extraction of Keywords Concepts and VocabulariesHaystack 2018 - Algorithmic Extraction of Keywords Concepts and Vocabularies
Haystack 2018 - Algorithmic Extraction of Keywords Concepts and Vocabularies
 
Sentence analysis
Sentence analysisSentence analysis
Sentence analysis
 
GPT for polyglots and language learners.pptx
GPT for polyglots and language learners.pptxGPT for polyglots and language learners.pptx
GPT for polyglots and language learners.pptx
 
An Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding SystemAn Intuitive Natural Language Understanding System
An Intuitive Natural Language Understanding System
 
Clean code lecture part I
Clean code lecture part IClean code lecture part I
Clean code lecture part I
 
G0361034038
G0361034038G0361034038
G0361034038
 

More from Charmi Chokshi

Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflow
Charmi Chokshi
 
Charmi chokshi ppt
Charmi chokshi pptCharmi chokshi ppt
Charmi chokshi ppt
Charmi Chokshi
 
From ELIZA to Alexa and Beyond
From ELIZA to Alexa and BeyondFrom ELIZA to Alexa and Beyond
From ELIZA to Alexa and Beyond
Charmi Chokshi
 
Report smart dustbin
Report smart dustbinReport smart dustbin
Report smart dustbin
Charmi Chokshi
 
Os prj ppt
Os prj pptOs prj ppt
Os prj ppt
Charmi Chokshi
 
magazine
magazinemagazine
magazine
Charmi Chokshi
 
Radio
RadioRadio
Trade relations US & India; the changing faces
Trade relations US & India; the changing facesTrade relations US & India; the changing faces
Trade relations US & India; the changing faces
Charmi Chokshi
 
Public vs private sector banks in india
Public vs private sector banks in indiaPublic vs private sector banks in india
Public vs private sector banks in india
Charmi Chokshi
 
Market analysis of pencil
Market analysis of pencilMarket analysis of pencil
Market analysis of pencil
Charmi Chokshi
 
Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...
Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...
Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...
Charmi Chokshi
 
Face recognition system using Hidden Markov Model
Face recognition system using Hidden Markov ModelFace recognition system using Hidden Markov Model
Face recognition system using Hidden Markov Model
Charmi Chokshi
 
Educational Resource Management System
Educational Resource Management SystemEducational Resource Management System
Educational Resource Management System
Charmi Chokshi
 
8 bit mips-processor
8 bit mips-processor8 bit mips-processor
8 bit mips-processor
Charmi Chokshi
 

More from Charmi Chokshi (14)

Deep learning with tensorflow
Deep learning with tensorflowDeep learning with tensorflow
Deep learning with tensorflow
 
Charmi chokshi ppt
Charmi chokshi pptCharmi chokshi ppt
Charmi chokshi ppt
 
From ELIZA to Alexa and Beyond
From ELIZA to Alexa and BeyondFrom ELIZA to Alexa and Beyond
From ELIZA to Alexa and Beyond
 
Report smart dustbin
Report smart dustbinReport smart dustbin
Report smart dustbin
 
Os prj ppt
Os prj pptOs prj ppt
Os prj ppt
 
magazine
magazinemagazine
magazine
 
Radio
RadioRadio
Radio
 
Trade relations US & India; the changing faces
Trade relations US & India; the changing facesTrade relations US & India; the changing faces
Trade relations US & India; the changing faces
 
Public vs private sector banks in india
Public vs private sector banks in indiaPublic vs private sector banks in india
Public vs private sector banks in india
 
Market analysis of pencil
Market analysis of pencilMarket analysis of pencil
Market analysis of pencil
 
Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...
Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...
Indian agriculture sector, Issues Related to Minimum Support Price, Subsidies...
 
Face recognition system using Hidden Markov Model
Face recognition system using Hidden Markov ModelFace recognition system using Hidden Markov Model
Face recognition system using Hidden Markov Model
 
Educational Resource Management System
Educational Resource Management SystemEducational Resource Management System
Educational Resource Management System
 
8 bit mips-processor
8 bit mips-processor8 bit mips-processor
8 bit mips-processor
 

Recently uploaded

CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
ydteq
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
BrazilAccount1
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 

Recently uploaded (20)

CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
一比一原版(UofT毕业证)多伦多大学毕业证成绩单如何办理
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
AP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specificAP LAB PPT.pdf ap lab ppt no title specific
AP LAB PPT.pdf ap lab ppt no title specific
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 

Dictionary implementation using TRIE

  • 1. Data Structures & Algorithms Project Title: Dictionary Implementation Using TRIE
  • 2. Problem Statement  Through our project we intend to help our user to find the meaning, synonyms, antonyms and examples of an entered word and if the user enters invalid word then we help them to explore more words similar to the entered word.  User can find translation of the entered word, also view the search history and also know ‘word of the day’ which enables the user to learn a new word every day.
  • 3. Algorithm Description  getnode() Description: This function returns the address of the newnode. Method: Allocate space to temporary variable temp and set all its alphabet node to NULL.Return temp.  printHistory() Description: This function prints the history of searched words. Method: Open the history file in read mode and read all the words one by one and display it  addHistory(key) Description: This function adds a word in the history file. Method: Open the history file in write mode and write the contents of key to it.  insert(root,key) Description: This function inserts a word in TRIE. Method: Access the TRIE from the root and set all the nodes (which come in the key) to TRUE and when the end of the word is reached then store the key in the fname field.  search(root,key) Description: This function searches for a key in TRIE. Method: Search each character level by level and if a specific character at a certain level does not exist then return false which means that the word does not exist . If all the characters exist then return TRUE.
  • 4.  insert_word(key) Description: This function inserts a new word in the Dictionary. Method: Store the word in TRIE.Store the meaning and description of the word in a file whose name is the word stored in key.  printData(key) Description: This function prints data from file name stored in key variable. Method: Open the file (whose name is stored in key field) and access all the characters and print them.  search_similar(root,key) Description: This function prints word similar to the word stored in key variable. Method: Access the TRIE from the root and if even if one of the letter in key variable doesn’t exist then the corresponding existing variable is accessed and the similar word is found.If none of the corresponding variable exist then print “The word doesn’t exist.”  wordRead(filename,choice) Description: This function prints the French word or Spanish word of a given word. Method: Ask the user to enter a word.Open the file(filename contains the name of the file) and search all the records one by one if the word entered by the user is found then the corresponding French or Spanish word is printed based on the choice of the user.  wordOfTheDay(root) Description: This function prints the word of the day. Method: Randomly generate any number and fetch the word from that location of the file(words.txt) and store it in file t_date and print the description of the word.
  • 5. Why did we use TRIE?  A Dictionary can also be implemented using other concepts (e.g. HASH TABLES).  Searching for data in a TRIE is faster.  free from collision.  no need to choose a hash function.  predetermined alphabetical ordering.  find words with common prefix.  Time Complexity:  We can search the key in O(M) time; M is length of the string.  Space Complexity:  Memory requirements of TRIE is O(ALPHABET_SIZE * key length * N) where N is number of keys in TRIE.
  • 6. Features of Project 1. Find meaning, description, synonyms, antonyms and examples of the entered word. 2. Insert new word in dictionary. 3. Find Similar words of the entered word. 4. Know ‘word of the day’. 5. Find translation of the entered word (English) in French & Spanish. 6. View search history.
  • 7. Input Output Screen Shots  Searching for a word  Similar words
  • 8.  Inserting a word & then searching for it
  • 9.  Finding translation  Word of the day
  • 10. Advantages  All in One!!  We have made an application which not only a simple dictionary which tells you the meaning of the entered word but also it tells you the whole description, synonyms, antonyms and practical use of that word in a sentence.  Even this is not the only feature but we created another application of Word Translation in this only which gives us the translation of entered word in either French or in Spanish  It provides Word of the Day which means every day our code will generate a random word from its memory and will give all the data related to it. One can learn at least a new word in a day and can increase his/her vocabulary using our application.  Our application can correct a wrong word as well. So in spite of displaying “Word not Found” like in case of many other dictionaries ,ours gives you Suggestions  Currently we have just 50-55 words in our dictionary but at any point of time one can Add a new Words in the Dictionary by first entering Password for the Safety.  We are also providing List of Frequently Searched Words. So to decrease the time complexity if the searched word is one of the Frequently searched word then our code will directly print the data of that file and if not than first traverse the TRIE than print the data.
  • 11. Disadvantages  Add New Word: While we do provide the functionality to add new words into the dictionary, though there is an inherent flaw in it - the person might enter any arbitrary sequence of characters (which the 'Trie ' identifies as a word).  For example - the person might enter 'asdfg' as a word into the file. Our program cannot distinguish between an arbitrary sequence of characters and a valid English word.  This basically implies that the software can be easily corrupted.  Deletion of a word: It can only be done by explicitly opening the text file containing the data and then deleting it.  Memory Consumption: Due to our lack of knowledge and time as well we have not implemented Word Scraping. So currently we are storing each data in Text File which consumes more memory but if we had used word scraping then our code might not be using any amount of memory.  Less Words : Though at any point of time one can Add new Words in our Dictionary but currently we have just 50-55 words in our dictionary  Search Incorrectly Spelled Word: We do have implemented an algorithm in which similar words to the incorrect word entered are shown to the user, but have not implemented anything which corrects the words which are spelled incorrectly.
  • 12. Real World Application of TRIE  Auto complete in web searching  Spell checker (Auto correct)  Word game  Dictionary  Longest prefix matching  Translator  Criminology  Phone book search