Giter VIP home page Giter VIP logo

gobbet's Introduction

gobbet - Random news articles in any language

Wikinews is a wonderful free source of long-form text in a variety of world languages. gobbet provides you with access to words, sentences and paragraphs taken from Wikinews articles in any of its supported languages. This can be used as filler text for type specimens, web layouts, etc.

Example usage

from gobbet import get_news, unicode_ranges

words, headlines, paragraphs = get_news("el") # ISO language code

# words is a Wordlist object; like Counter, but with a few more methods
words = (
    words.filter_popularity(2) # Only words which occur >=2 times
         .filter_length(5)     # ... of five letters or more ...
         .filter_unicodes(unicode_ranges["Greek"]) # .. in Greek script
)

# Want to find some kerning pair words?
bigrams = words.bigrams()
# bigrams['οώ'] === {'προώθησε', 'προώθηση', 'προώθησης', 'προώρων'}

# headlines and paragraphs are just lists, but...
from gobbet import filter_length, filter_unicodes

renderable = filter_unicodes(headlines, [font.getBestCmap().keys()])

License

gobbet was written by Simon Cozens. See LICENSE for the terms of this library.

Note that Wikinews text is provided under the CC-BY 2.5 license, and your application must comply with the terms of that license in its use of the content.

gobbet's People

Contributors

simoncozens avatar

Watchers

 avatar James Cloos avatar Elias Zolotas 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.