├── .gitattributes ├── CONTRIBUTING.md ├── .github ├── dependabot.yml ├── ISSUE_TEMPLATE │ └── feature_request.md ├── FUNDING.yml └── workflows │ └── codeql.yml ├── SECURITY.md ├── LICENSE ├── README.md ├── Dictionary.json ├── Dictionary.js ├── Dictionary.html └── CODE_OF_CONDUCT.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | https://github.com/KidiIT/Free--Dictionary-API/blob/main/Dictionary.js 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Enable version updates for npm 4 | - package-ecosystem: "npm" 5 | # Look for `package.json` and `lock` files in the `root` directory 6 | directory: "/" 7 | # Check the npm registry for updates every day (weekdays) 8 | schedule: 9 | interval: "daily" 10 | 11 | # Enable version updates for Docker 12 | - package-ecosystem: "docker" 13 | # Look for a `Dockerfile` in the `root` directory 14 | directory: "/" 15 | # Check for updates once a week 16 | schedule: 17 | interval: "weekly" 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | job_id: 3 | permissions: 4 | contents: 'read' 5 | id-token: 'write' 6 | 7 | steps: 8 | 9 | # ... 10 | 11 | - uses: 'google-github-actions/auth@v2' 12 | with: 13 | workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider' 14 | service_account: 'my-service-account@my-project.iam.gserviceaccount.com' 15 | 16 | - uses: 'google-github-actions/deploy-cloudrun@v2' 17 | with: 18 | image: 'gcr.io/cloudrun/hello' 19 | service: 'hello-cloud-run' 20 | github: [KIDI’S TECH.com,kidiit] 21 | patreon: KIDI'S-TECH@patreon.com 22 | community_bridge: https://openprofile.dev/profile/kiditech 23 | custom: [https://github.com/KIDI-S-TECH, https://github.com/KidiIT] 24 | -------------------------------------------------------------------------------- /.github/workflows/codeql.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | schedule: 9 | - cron: '26 7 * * 4' 10 | 11 | jobs: 12 | analyze: 13 | name: Analyze 14 | runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} 15 | timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | language: [ 'javascript-typescript'] 25 | steps: 26 | - name: Checkout repository 27 | uses: actions/checkout@v4 28 | 29 | 30 | - name: Initialize CodeQL 31 | uses: github/codeql-action/init@v3 32 | with: 33 | languages: ${{ matrix.language }} 34 | 35 | - name: Autobuild 36 | uses: github/codeql-action/autobuild@v3 37 | 38 | 39 | - name: Perform CodeQL Analysis 40 | uses: github/codeql-action/analyze@v3 41 | with: 42 | category: "/language:${{matrix.language}}" 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 KIDI'S-TECH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://doi.org/10.5281/zenodo.10829824) 2 | ## Free Dictionary API 3 | 4 | I came across an inspiring free Dictionary API created. however, with my initiative i was able to build a Dictionary APl that can be used at your comfort zone. 5 | furthermore, the framework of my program includes vocal of any key been searched on the dictionary, key and meaning that are been fletched from the dictionary-api.moreover, it can be very useful in the community and can be compatible with anyone who find it hard to operate a computer eg.kids,computer illterate and can be used at your own 6 | convenience. 7 | 8 | In Summary, my main aim of creating this project was to sharpen my skills on javascript on how to handle large amount of data-set with dictionary-api as a module. 9 | NOTE: surely your Internet connection should be 100% active when running the program to be able to access the data from the API and you can always check It out to review more about the project. 10 | I'll also be working with the community in a way to make it easier for people who want it easier for us and the service providers to access the information from our customers in a timely fashion so they don't get the wrong impression and can easily get a response to it without any delay or any additional issues or problems that may be arise from the other service providers. 🙏 looking forward for any feedback from the project team Thanks! 11 | -------------------------------------------------------------------------------- /Dictionary.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "word": "hello", 4 | "phonetic": "həˈləʊ", 5 | "phonetics": [ 6 | { 7 | "text": "həˈləʊ", 8 | "audio": "//ssl.gstatic.com/dictionary/static/sounds/20200429/hello--_gb_1.mp3" 9 | }, 10 | { 11 | "text": "hɛˈləʊ" 12 | } 13 | ], 14 | "origin": "early 19th century: variant of earlier hollo ; related to holla.", 15 | "meanings": [ 16 | { 17 | "partOfSpeech": "exclamation", 18 | "definitions": [ 19 | { 20 | "definition": "used as a greeting or to begin a phone conversation.", 21 | "example": "hello there, Katie!", 22 | "synonyms": [], 23 | "antonyms": [] 24 | } 25 | ] 26 | }, 27 | { 28 | "partOfSpeech": "noun", 29 | "definitions": [ 30 | { 31 | "definition": "an utterance of ‘hello’; a greeting.", 32 | "example": "she was getting polite nods and hellos from people", 33 | "synonyms": [], 34 | "antonyms": [] 35 | } 36 | ] 37 | }, 38 | { 39 | "partOfSpeech": "verb", 40 | "definitions": [ 41 | { 42 | "definition": "say or shout ‘hello’.", 43 | "example": "I pressed the phone button and helloed", 44 | "synonyms": [], 45 | "antonyms": [] 46 | } 47 | ] 48 | } 49 | ] 50 | } 51 | ] -------------------------------------------------------------------------------- /Dictionary.js: -------------------------------------------------------------------------------- 1 | let myDictionaryForm = document.forms.dictionary_form; 2 | let displayContainer = document.querySelector('[data-displayContainer]') 3 | let searchContainer = document.querySelector('[data-searchContainer]') 4 | let userInput = document.querySelector("input") 5 | let templateDefinition = document.querySelector("[data-definitionTemplate]") 6 | myDictionaryForm.onsubmit=(e)=>{ 7 | e.preventDefault(); 8 | let myDictionaryValue= userInput.value.trim(); 9 | const fetchPromise = new Promise(async(resolve, reject) => { 10 | let data=await fetch('https://api.dictionaryapi.dev/api/v2/entries/en/'+myDictionaryValue); 11 | let json =await data.json(); 12 | 13 | if (data.ok) { 14 | resolve(json); 15 | 16 | }else { 17 | reject({mssg:"cannot fetch data from this url "+data.url,words:json}); 18 | } 19 | 20 | }).then(getWord,rejectFetch) 21 | 22 | 23 | } 24 | function getWord(word) { 25 | let searchData = searchContainer.content.cloneNode(true).children[0]; 26 | let title = searchData.querySelector('[data-title]'); 27 | let speak = searchData.querySelector('[data-speak]').src = word[0].phonetics[1].audio 28 | let speakClick = searchData.querySelector('[data-speakClick]') 29 | speakClick.onclick = ()=>{ 30 | searchData.querySelector('[data-speak]').play() 31 | console.log(speak); 32 | } 33 | title.textContent = word[0].word 34 | word.map((data,key)=>{ 35 | let definitionTemplate = searchData.querySelector('[data-definitionTemplate]').content.cloneNode(true).children[0]; 36 | let definition = definitionTemplate.querySelector('[data-definition]') 37 | console.log(data.meanings); 38 | definition.textContent =data.meanings[key].definitions[key].definition 39 | searchData.querySelector('[data-define]').append(definition) 40 | }) 41 | displayContainer.append(searchData) 42 | } 43 | function rejectFetch(err) { 44 | console.log(err); 45 | } 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /Dictionary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |