Giter Club home page Giter Club logo

hacks's Introduction

This is a collection of various hacks

Well, not a very large collection right now, since there's only few hacks here, but still... :-)

beam

The idea behind beam_renamer is to be able to load an erlang module (which is already compiled) under a different name. Normally, there's an error message if one does that:

1> {x, Bin, _} = code:get_object_code(x).
{x,<<...>>,...}
2> code:load_binary(y, "y.beam", Bin).
{error,badfile}

=ERROR REPORT==== 8-Nov-2009::22:01:24 ===
Loading of y.beam failed: badfile

=ERROR REPORT==== 8-Nov-2009::22:01:24 ===
beam/beam_load.c(1022): Error loading module y:
  module name in object code is x

This is where beam_renamer comes in handy. It'll rename the module by replacing the module name within the beam file.

1> {x, Bin0, _} = code:get_object_code(x).
{x,<<...>>,...}
2> Bin = beam_renamer:rename(Bin0, y).
<<...>>
2> code:load_binary(y, "y.beam", Bin).
{module,y}

See the comments in the source code for more details.

stem

stem_en is an implementation of the English Porter2 stemming algorithm.

The implementation has been tested on the sample English vocabulary and produces an identical result when compared to its stemmed reference equivalent. Some performance figures: stems 400,000 words per second on a 2.53 GHz Core 2 Duo MacBook Pro.

stem_sv is its Swedish counterpart. Some performance figures: stems 900,000 words per second on a 2.53 GHz Core 2 Duo MacBook Pro.

hacks's People

Contributors

klajo 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.