guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 58/86] gnu: Add rust-aho-corasick.


From: ng0
Subject: [PATCH 58/86] gnu: Add rust-aho-corasick.
Date: Tue, 3 Jan 2017 23:36:14 +0000

* gnu/packages/rust.scm (rust-aho-corasick): New variable.
---
 gnu/packages/rust.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index f415c91e4..b6946e825 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1594,3 +1594,42 @@ big-endian and little-endian.")
      "@code{csv} provides CSV parsing with automatic type
 based decoding and encoding.")
     (license (list license:unlicense license:expat))))
+
+(define-public rust-aho-corasick
+  (package
+    (name "rust-aho-corasick")
+    (version "0.5.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "aho-corasick" version))
+       (file-name
+        (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0rnvdmlajikq0i4zdy1p3pv699q6apvsxfc7av7byhppllp2r5ya"))))
+    (build-system cargo-build-system)
+    (native-inputs
+     `(("rust-csv" ,rust-csv "src")
+       ("rust-docopt" ,rust-docopt "src")
+       ("rust-memmap" ,rust-memmap "src")
+       ("rust-quickcheck" ,rust-quickcheck "src")
+       ("rust-rand" ,rust-rand "src")
+       ("rust-rustc-serialize" ,rust-rustc-serialize "src")))
+    (inputs
+     `(("rust-memchr" ,rust-memchr "src")))
+    (home-page "https://github.com/BurntSushi/aho-corasick";)
+    (synopsis "Fast implementation of Aho-Corasick in Rust")
+    (description
+     "@code{aho-corasick} provides an implementation of the
+Aho-Corasick algorithm.  Its intended use case is for fast substring
+matching, particularly when matching multiple substrings in a search
+text.  This is achieved by compiling the substrings into a finite
+state machine.
+
+This implementation provides optimal algorithmic time complexity.
+Construction of the finite state machine is O(p) where p is the length
+of the substrings concatenated.  Matching against search text is
+O(n + p + m), where n is the length of the search text and m is the
+number of matches.")
+    (license (list license:unlicense license:expat))))
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]