Code Monkey home page Code Monkey logo

gofind's Introduction

gofind

A script I made to index .txt files in a directory and sub directorys so I can use cat and grep to search them. I chose Go because 1. I wanted to learn it and 2. indexing multiple files could be parallelized and Go seemed like a good choice.

How it works

A main thread scans the first level directory and makes a channel for goroutines to dump word: filename maps to, then the main thread collects the maps together and writes an index line by line. Words in the index are lowercased and sanitized of any non-alphanumeric start and end characters. The index file can then be greped for the word you're looking for.

Stuff I'd like to do

  • add support for different text document types (pdf, namely, probably docx, odt?)
  • add more terminal options/configuration (thread count, recursion depth, whether the output is sorted)
  • add a way to better search the end result and display it better to the user
  • reduce memory consumption while indexing, it all dumps into a huge map right now
  • use some naive map-reduce to create the index faster/more distributed

gofind's People

Contributors

ryanmahan avatar

Watchers

James Cloos 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.