Skip to content

Commit 90c06af

Browse files
authored
Merge pull request #3 from rssdev10/fix/ci_doc
minor style fixes and scripts updates
2 parents 0e4bd0e + d8a5080 commit 90c06af

File tree

9 files changed

+62
-52
lines changed

9 files changed

+62
-52
lines changed

.github/workflows/CompatHelpter.yml

+33-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,43 @@ on:
33
schedule:
44
- cron: 05 03 * * *
55
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
69
jobs:
710
CompatHelper:
811
runs-on: ubuntu-latest
912
steps:
10-
- name: Pkg.add("CompatHelper")
11-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12-
- name: CompatHelper.main()
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
1342
env:
1443
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1544
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16-
run: julia -e 'using CompatHelper; CompatHelper.main()'
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/TagBot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ on:
88
lookback:
99
default: 3
1010
permissions:
11+
actions: read
12+
checks: read
1113
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
1223
jobs:
1324
TagBot:
1425
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
@@ -17,3 +28,5 @@ jobs:
1728
- uses: JuliaRegistries/TagBot@v1
1829
with:
1930
token: ${{ secrets.GITHUB_TOKEN }}
31+
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
32+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
version:
16-
- '1.3'
16+
- '1.6'
1717
- '1'
1818
- 'nightly'
1919
os:
@@ -29,15 +29,15 @@ jobs:
2929
# MacOS not available on x86
3030
- {os: 'macOS-latest', arch: 'x86'}
3131
# Don't test on all versions
32-
- {os: 'macOS-latest', version: '1.3'}
32+
- {os: 'macOS-latest', version: '1.6'}
3333
- {os: 'macOS-latest', version: 'nightly'}
34-
- {os: 'windows-latest', version: '1.3'}
34+
- {os: 'windows-latest', version: '1.6'}
3535
- {os: 'windows-latest', version: 'nightly'}
3636
- {os: 'windows-latest', arch: 'x86'}
37-
- {arch: 'x86', version: '1.3'}
37+
- {arch: 'x86', version: '1.6'}
3838
- {arch: 'x86', version: 'nightly'}
3939
steps:
40-
- uses: actions/checkout@v1
40+
- uses: actions/checkout@v4
4141
- uses: julia-actions/setup-julia@latest
4242
with:
4343
version: ${{ matrix.version }}
@@ -50,10 +50,10 @@ jobs:
5050
name: Documentation
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v1
53+
- uses: actions/checkout@v4
5454
- uses: julia-actions/setup-julia@latest
5555
with:
56-
version: '1.5'
56+
version: '1.9'
5757
- run: julia --project=docs -e '
5858
using Pkg;
5959
Pkg.develop(PackageSpec(; path=pwd()));

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.vscode
23
/Manifest.toml
34
/dev/
45
/docs/build/

.travis.yml

-25
This file was deleted.

Project.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Snowball"
22
uuid = "fb8f903a-0164-4e73-9ffe-431110250c3b"
33
authors = ["Avik Sengupta", "Julia Computing"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

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

1111
[compat]
1212
Languages = "0.4"
13+
Snowball_jll = "2"
1314
WordTokenizers = "0.5"
1415
julia = "1.3"
1516

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ This code was extracted from the [TextAnalysis.jl](https://github.com/juliatext/
66

77
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliahub.com/docs/Snowball)
88
[![version](https://juliahub.com/docs/Snowball/version.svg)](https://juliahub.com/ui/Packages/Snowball/agUCL)
9-
[![Build Status](https://travis-ci.org/juliatext/Snowball.jl.svg?branch=master)](https://travis-ci.com/juliatext/Snowball.jl)
109
[![deps](https://juliahub.com/docs/Snowball/deps.svg)](https://juliahub.com/ui/Packages/Snowball/agUCL?t=2)

docs/make.jl

-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ makedocs(;
66
pages=[
77
"Home" => "index.md",
88
],
9-
repo="https://github.com/juliatext/Snowball.jl/blob/{commit}{path}#L{line}",
109
sitename="Snowball.jl",
1110
authors="Avik Sengupta, Julia Computing",
12-
assets=String[],
1311
)
1412

1513
deploydocs(;

src/Snowball.jl

+6-12
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ end
7878

7979
"""
8080
stem(stemmer::Stemmer, str)
81-
stem(stemmer::Stemmer, words::Array)
81+
stem(stemmer::Stemmer, words::Vector)
8282
8383
Stem the input with the Stemming algorthm of `stemmer`.
8484
85-
See also: [`stem!`](@ref)
85+
See also: [`stem_all`](@ref)
8686
"""
87-
function stem(stemmer::Stemmer, bstr::AbstractString)
87+
function stem(stemmer::Stemmer, bstr::AbstractString)::String
8888
sres = ccall((:sb_stemmer_stem, libstemmer),
8989
Ptr{UInt8},
9090
(Ptr{UInt8}, Ptr{UInt8}, Cint),
@@ -100,19 +100,13 @@ end
100100
101101
tokenize the string with the default tokenizer, and then stem each word
102102
"""
103-
function stem_all(stemmer::Stemmer, sentence)
103+
function stem_all(stemmer::Stemmer, sentence::AbstractString)::String
104104
tokens = tokenize(sentence)
105105
stemmed = stem(stemmer, tokens)
106106
join(stemmed, ' ')
107107
end
108108

109-
function stem(stemmer::Stemmer, words::Array)
110-
l::Int = length(words)
111-
ret = Array{String}(undef, l)
112-
for idx in 1:l
113-
ret[idx] = stem(stemmer, words[idx])
114-
end
115-
return ret
116-
end
109+
stem(stemmer::Stemmer, words::Vector{<:AbstractString})::Vector{String} =
110+
map(w -> stem(stemmer, w), words)
117111

118112
end # module

0 commit comments

Comments
 (0)