GithubHelp home page GithubHelp logo

luisligunas / pinoy-dictionary-scraper Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 0.0 19.45 MB

Generates a Filipino dictionary with Tagalog, Cebuano, Hiligaynon, and Ilocano words by scraping data from pinoydictionary.com

License: MIT License

Python 100.00%
python scraping beautifulsoup4 dictionaries filipino-dictionary tagalog-dictionary cebuano-dictionary hiligaynon-dictionary ilocano-dictionary wordlist

pinoy-dictionary-scraper's Introduction

Pinoy Dictionary Scraper

Scrapes Tagalog, Cebuano, Hiligaynon, and Ilocano words from Pinoy Dictionary

The scraped words are then printed into an output file in a UTF-8-encoded JSON format.

If all you need is to get a word list (with or without definitions) for your app, you may just go to the Scraped Data folder.

Note: The Ilocano dictionary is a list of English words with Ilocano definitions.

Setup

We need to have Python 3, BeautifulSoup and Requests installed on your machine. If you already have these, then you should be able to run the scraper files without any additional setup.

Please ensure that you are running Python 3 or newer and NOT Python 2. The scraper uses functionality in argparse that is only available on Python 3.

Pip Installation

To install BeautifulSoup and Requests, we need Python's pip package.

According to pip's documentation, you can install pip by running:

sudo python -m ensurepip --upgrade

BeautifulSoup Installation

According to BeautifulSoup's implementation, you can install BeautifulSoup by running:

pip install beautifulsoup4

If this doesn't work you may have to try

pip install beautifulsoup4 --user

or

sudo pip install beautifulsoup4

Requests Installation

According to Requests' implementation, you can install Requests by running:

python -m pip install requests

Scraping

Run the following command:

python scraper.py [--dictionaries <dictionaries>] [--output_file <file_name>]

Options

--dictionaries <dictionaries>

The dictionaries value that you should pass in should be a comma-separated string containing any of the following strings: "tagalog", "cebuano", "hiligaynon", "ilocano"

For example, if you wanted to scrape the data for Tagalog, Cebuano, and Hiligaynon, you would use --dictionaries tagalog,cebuano,hiligaynon.

If this argument is not specified, words from all dictionaries will be scraped.

--output_file <file_name>

The file_name value that you should pass in should be the file that you would like to print the words in.

For example, if you wanted to print the Tagalog words into a file named tagalog_dictionary.json, you would run the command python scraper.py --dictionaries tagalog --output_file tagalog_dictionary.json.

It is advised to specify this argument; if it is not specified, the value will be printed out on the console (or wherever the console output may be redirected to).

pinoy-dictionary-scraper's People

Contributors

actions-user avatar luisligunas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.