Skip to content

Commit

Permalink
Merge pull request #3 from rssdev10/fix/ci_doc
Browse files Browse the repository at this point in the history
minor style fixes and scripts updates
  • Loading branch information
aviks authored Oct 30, 2023
2 parents 0e4bd0e + d8a5080 commit 90c06af
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 52 deletions.
37 changes: 33 additions & 4 deletions .github/workflows/CompatHelpter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,43 @@ on:
schedule:
- cron: 05 03 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
13 changes: 13 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ on:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand All @@ -17,3 +28,5 @@ jobs:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
ssh: ${{ secrets.DOCUMENTER_KEY }}
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
version:
- '1.3'
- '1.6'
- '1'
- 'nightly'
os:
Expand All @@ -29,15 +29,15 @@ jobs:
# MacOS not available on x86
- {os: 'macOS-latest', arch: 'x86'}
# Don't test on all versions
- {os: 'macOS-latest', version: '1.3'}
- {os: 'macOS-latest', version: '1.6'}
- {os: 'macOS-latest', version: 'nightly'}
- {os: 'windows-latest', version: '1.3'}
- {os: 'windows-latest', version: '1.6'}
- {os: 'windows-latest', version: 'nightly'}
- {os: 'windows-latest', arch: 'x86'}
- {arch: 'x86', version: '1.3'}
- {arch: 'x86', version: '1.6'}
- {arch: 'x86', version: 'nightly'}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
Expand All @@ -50,10 +50,10 @@ jobs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1.5'
version: '1.9'
- run: julia --project=docs -e '
using Pkg;
Pkg.develop(PackageSpec(; path=pwd()));
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.vscode
/Manifest.toml
/dev/
/docs/build/
Expand Down
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Snowball"
uuid = "fb8f903a-0164-4e73-9ffe-431110250c3b"
authors = ["Avik Sengupta", "Julia Computing"]
version = "0.1.0"
version = "0.1.1"

[deps]
Languages = "8ef0a80b-9436-5d2c-a485-80b904378c43"
Expand All @@ -10,6 +10,7 @@ WordTokenizers = "796a5d58-b03d-544a-977e-18100b691f6e"

[compat]
Languages = "0.4"
Snowball_jll = "2"
WordTokenizers = "0.5"
julia = "1.3"

Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ This code was extracted from the [TextAnalysis.jl](https://github.com/juliatext/

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliahub.com/docs/Snowball)
[![version](https://juliahub.com/docs/Snowball/version.svg)](https://juliahub.com/ui/Packages/Snowball/agUCL)
[![Build Status](https://travis-ci.org/juliatext/Snowball.jl.svg?branch=master)](https://travis-ci.com/juliatext/Snowball.jl)
[![deps](https://juliahub.com/docs/Snowball/deps.svg)](https://juliahub.com/ui/Packages/Snowball/agUCL?t=2)
2 changes: 0 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ makedocs(;
pages=[
"Home" => "index.md",
],
repo="https://github.com/juliatext/Snowball.jl/blob/{commit}{path}#L{line}",
sitename="Snowball.jl",
authors="Avik Sengupta, Julia Computing",
assets=String[],
)

deploydocs(;
Expand Down
18 changes: 6 additions & 12 deletions src/Snowball.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ end

"""
stem(stemmer::Stemmer, str)
stem(stemmer::Stemmer, words::Array)
stem(stemmer::Stemmer, words::Vector)
Stem the input with the Stemming algorthm of `stemmer`.
See also: [`stem!`](@ref)
See also: [`stem_all`](@ref)
"""
function stem(stemmer::Stemmer, bstr::AbstractString)
function stem(stemmer::Stemmer, bstr::AbstractString)::String
sres = ccall((:sb_stemmer_stem, libstemmer),
Ptr{UInt8},
(Ptr{UInt8}, Ptr{UInt8}, Cint),
Expand All @@ -100,19 +100,13 @@ end
tokenize the string with the default tokenizer, and then stem each word
"""
function stem_all(stemmer::Stemmer, sentence)
function stem_all(stemmer::Stemmer, sentence::AbstractString)::String
tokens = tokenize(sentence)
stemmed = stem(stemmer, tokens)
join(stemmed, ' ')
end

function stem(stemmer::Stemmer, words::Array)
l::Int = length(words)
ret = Array{String}(undef, l)
for idx in 1:l
ret[idx] = stem(stemmer, words[idx])
end
return ret
end
stem(stemmer::Stemmer, words::Vector{<:AbstractString})::Vector{String} =
map(w -> stem(stemmer, w), words)

end # module

2 comments on commit 90c06af

@aviks
Copy link
Member Author

@aviks aviks commented on 90c06af Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/96670

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" 90c06af596fffe32318b99e288c6778b0d91905f
git push origin v0.1.1

Please sign in to comment.