0% found this document useful (0 votes)
14 views3 pages

Project - RC Wordbook v1

Rodzan Carl O. Akiatan's portfolio project, titled 'RC - WORDBOOK V1', is a Python-based application that utilizes the Merriam-Webster Dictionary API to provide definitions for user-inputted words. The project includes instructions for usage, technical details about the API, and future plans for creating a comprehensive online dictionary. The code demonstrates how to fetch and display word definitions using the API, with a focus on user accessibility and a clean interface.

Uploaded by

Steel Ronin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views3 pages

Project - RC Wordbook v1

Rodzan Carl O. Akiatan's portfolio project, titled 'RC - WORDBOOK V1', is a Python-based application that utilizes the Merriam-Webster Dictionary API to provide definitions for user-inputted words. The project includes instructions for usage, technical details about the API, and future plans for creating a comprehensive online dictionary. The code demonstrates how to fetch and display word definitions using the API, with a focus on user accessibility and a clean interface.

Uploaded by

Steel Ronin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Name: Rodzan Carl O.

Akiatan
Year & Section: BSCE CEM 2A
SUBJECT: COMPUTER PROGRAMMING 2

PYTHON FOR BEGINNERS: PORTFOLIO PROJECT


PROJECT TITLE: RC - WORDBOOK V1

PROJECT CODE:
FINAL ACTIVITY
https://replit.com/@rodmancarlot/FINAL-ACTIVITY
COMPILATION
https://replit.com/@rodmancarlot/Compilation#COMPILATION/activity6.py

HOW TO USE:
1. Open replit website
2. Click the code and run the program
3. Enter a word that you that you want to search and see its definitions
4. Definitions will show
5. click x if you are done searching the definition that you want.

TECHNICAL DETAILES
- the merriam webster dictionary api is a powerful tool for accessing a vast repository of
words and their meanings. here are some technical details about the api:
-
- api endpoint: the api endpoint is
https://www.dictionaryapi.com/api/v3/references/thesaurus/json/.
-
- api key: to use the api, you need to obtain an api key, which is required in the request url.
for example,
https://www.dictionaryapi.com/api/v3/references/thesaurus/json/umpire?key=yourkey
- response format: the api response is in json format.
- top-level keys: the response contains five top-level keys: meta, hwi, fl, def, and shortdef.

- meta: the meta key contains metadata about the word, including id, uuid, src, section,
stems, and syns.
- hwi: the hwi key contains headword information, including the hw string headword.
- fl: the fl key contains functional label information, which tells the grammatical function
of the word (e.g., noun, adjective, etc.).
- def: the def key contains definition information, including sense sequences and verb
dividers (transitive/intransitive). each sense sequence contains a series of senses, and
each sense contains a defining text array with the definition of the word and verbal
illustrations (example sentences).
FUTURE PLANS
- Creating an online dictionary is an ambitious and rewarding project that can serve a wide
audience. Here's an explanation of your future plans for the online dictionary you have
created:
- Vision and Purpose, The primary vision for the online dictionary is to provide a
comprehensive, user-friendly, and reliable resource for anyone seeking to understand
and use words effectively. The purpose is to make language learning and usage accessible
to everyone, regardless of their background or language proficiency.
- Features and Functionality, Extensive Word Database: The dictionary will feature a vast
database of words, including definitions, pronunciations, synonyms, antonyms, and
usage examples. Regular updates will ensure that the dictionary remains current and
relevant.
- User Interface and Experience: A clean, intuitive user interface will make it easy for users
to search for words, navigate through related terms, and explore the richness of the
language. Mobile optimization is a priority to ensure accessibility on various devices.

PHYTHON CODE:

import requests
def get_word_definition(word):

api_key = "2f27baff-7de7-4780-82a6-8bd26e2ade09"

url = f"https://www.dictionaryapi.com/api/v3/references/collegiate/json/{word}?key={api_key}"

try:

response = requests.get(url)

data = response.json()

if isinstance(data, list):

# Assuming the first item in the list is the main definition

definition = data[0].get("shortdef")

if definition:

return definition[0]

else:

return "No definition found."

else:

return "Word not found."

except requests.exceptions.RequestException as e:

return f"Error: {e}"

word_to_define = input("Enter a word to get its definition: ")

definition = get_word_definition(word_to_define)

print(definition)

You might also like