GithubHelp home page GithubHelp logo

locality_search's Introduction

Locality searcher implemented in Ruby. This is a command line utility to search a document for two terms and determine whether the two terms appear in the document within a certain distance from each other. Given a directory, the locality searcher will output a list of the documents that meet the criterion of having the two given terms within the given distance.

Dependencies:

  1. Ruby standard library
  2. locality_search.rb must be executable
  3. /usr/bin/env ruby must be set

Install and Use:

  1. git clone https://github.com/tlewis11/locality_search
  2. cd locality_search
  3. ./locality_search.rb Python Ruby -d someDirectoryToSearch -n 3

This will search someDirectoryToSearch and return a json encoded list of all the documents containing the terms Python and Ruby that occur within 3 words of each other

Usage: locality_search.rb [options] TERMONE TERMTWO -d, --directory [DIR] directory to search. Default to current dir . -l, --locality-factor [N] The distance within which the terms must appear. Default is 2 -t, --test Perform unit tests. Exits after tests are complete. -h, --help print this help message

Tested on:

OSX 10.11.3 (El Capitan)
ruby 2.0.0p645

locality_search's People

Watchers

Tim Lewis 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.