-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crfsuite 0.12 (new formula) #122035
Closed
Closed
crfsuite 0.12 (new formula) #122035
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class Crfsuite < Formula | ||
desc "Fast implementation of conditional random fields" | ||
homepage "https://www.chokkan.org/software/crfsuite/" | ||
url "https://github.com/downloads/chokkan/crfsuite/crfsuite-0.12.tar.gz" | ||
sha256 "e7fc2d88353b1f4de799245f777d90f3c89a9d9744ba9fbde8c7553fa78a1ea1" | ||
license "BSD-3-Clause" | ||
|
||
depends_on "liblbfgs" | ||
|
||
uses_from_macos "python" => :test | ||
|
||
resource "homebrew-conll2000-training-data" do | ||
url "https://www.cnts.ua.ac.be/conll2000/chunking/train.txt.gz" | ||
sha256 "bcbbe17c487d0939d48c2d694622303edb3637ca9c4944776628cd1815c5cb34" | ||
end | ||
|
||
def install | ||
args = std_configure_args | ||
args << "--disable-sse2" if Hardware::CPU.arm? | ||
|
||
system "./configure", *args | ||
system "make", "install" | ||
|
||
pkgshare.install "example" | ||
end | ||
|
||
test do | ||
resource("homebrew-conll2000-training-data").stage testpath | ||
|
||
# Use spawn instead of {shell,pipe}_output to directly read and write | ||
# from files. The data is too big to read into memory and then pass to | ||
# the command for this test to complete within the alloted timeout. | ||
command = ["python3", pkgshare/"example/chunking.py"] | ||
pid = spawn(*command, in: "train.txt", out: "train.crfsuite.txt") | ||
Process.wait(pid) | ||
|
||
system bin/"crfsuite", "learn", "--model", "CoNLL2000.model", "train.crfsuite.txt" | ||
assert_predicate testpath/"CoNLL2000.model", :exist? | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I didn't know there's such links like
https://github.com/downloads/...
I'd suggest switching it to the format we usually use:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. This is borrowing from an existing formula in the
homebrew-science
(legacy) tap.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, these two tarballs don't have the same contents. The original one I had includes a pre-generated
configure
file. The/archive
tarball doesn't have it.It seems there are other formulae in core tap that use this kind of link, e.g.
apktool
,jadx
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, wow, old stuff!
TIL there was a downloads API that was replaced with releases like 10 years ago.
Source: https://stackoverflow.com/questions/63292793/how-can-i-upload-files-to-https-github-com-downloads-user-repo