Git Product home page Git Product logo

sonnetsdemo's Introduction

Sonnets Xapian Demo

@author: Matt Story <[email protected]>
@license: BSD 3-Clause (see LICENSE)

The Slides

The Sonnets Xapian Demo was built for the Getting Started with Python and Xapian -- HackNY HackNY Spring Student Hackathon, where I participated as a tech ambassador (although the talk was not given due to room difficulties).

The Sonnets

The sonnets were taken by hand from here, and parsed. This content is available freely under the public domain in the USA.

The Demos

index-sonnets.py

index-sonnets.py takes an list of files to index on the command-line:

$ python index-sonnets.py sonnets/1 sonnets/2 # etc ...

And indexes them with the author 'William Shakespeare' to the database ./xdb/sonnets.db. To index all the sonnets:

$ find shakespeare/ -type f  | xargs python index-sonnets.py

search-sonnets.py

query-sonnets.py takes a query string as its first argument, an optional author query string for its second argument and optionally number of lines in the sonnet as its third argument (admittedly a terrible interface, but it's a demo ...). Some things you can try:

$ python query-sonnets.py 'shall'
$ python query-sonnets.py 'shall' '' 15
$ python query-sonnets.py '' '' 16

sonnetsdemo's People

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.