Git Product home page Git Product logo

pase's Introduction

PaSe

Pa(tch)Se(arch) is an experimental search engine for code allowing search by patch.

It will return files by applicability of a specified patch.

Indexing

To index a source directory:

java -jar pase.jar index <source_path> <index_path>

Searching

Once indexing has finished, you can search:

  • on the command line: use java -jar pase.jar search <index_path> <patch_path>
  • via API:
    • use java -jar pase.jar serve <index_path> to start the PaSe Server
    • query the URL http://localhost:4567/search?patch=URL_ENCODED_PATCH to get results as JSON (see utils/example_client.py for a full example)
  • via the Web UI:
    • use java -jar pase.jar serve <index_path> to start the PaSe Server
    • visit http://localhost:4567 with your browser

Screen capture of PaSe's Web UI

pase's People

Contributors

boiko avatar moio avatar ncounter avatar osomon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pase's Issues

Some patches do not parse

> java -jar pase/target/pase-0.1-SNAPSHOT.jar search ./opensuse-index/ ./opensuse/bazel2.0-2.0.0-lp152.3.2.src.rpm_contents/bazel-2.0.0-dist.zip_contents/third_party/aws-sdk-auth-lite/patches-vs-1.11.297/01-bazel-strip-unused.patch

Exception in thread "main" com.github.difflib.unifieddiff.UnifiedDiffParserException: expected file start line not found
        at com.github.difflib.unifieddiff.UnifiedDiffReader.parse(UnifiedDiffReader.java:90)
        at com.github.difflib.unifieddiff.UnifiedDiffReader.parseUnifiedDiff(UnifiedDiffReader.java:136)
        at com.suse.pase.PatchParser.parsePatch(PatchParser.java:26)
        at com.suse.pase.Main.search(Main.java:39)
        at com.suse.pase.Main.main(Main.java:17)

Index trigrams

One Lucene limitation when it comes to fuzzy search is that the maximum edit distance is capped to 2 due to algorithmic reasons.

One way to circumvent this is to index trigrams instead of lines, thereby allowing some trigrams to be missing or be different in sequence, rather than searching for lines and allowing fuzzy matching with up to two edits.

This requires changing SourceAnalyzer to decompose text in trigrams and, crucially, rewrite queries so that they target trigrams.

Then performance has to be evaluated (time-wise and search-effectiveness-wise).

Try again GraalVM

Building a standalone binary with GraalVM's native-image was attempted a while ago but got blocked by oracle/graal#2761 (needed by Lucene, see oracle/graal#2721).

Now the issue has been resolved and it would be cool to have a standalone binary again.

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.