Skip to content

Commit

Permalink
Update to openfst 1.8.3. Add README.md information
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentbartholdi committed Jul 12, 2024
1 parent 95c2846 commit 7a1715c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 7 deletions.
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
# OpenFST

Implements finite state transducers via the C++ library [OpenFST](https://www.openfst.org). Its syntax follows closely that of the C++ library.

```julia
julia> using Pkg; Pkg.add("OpenFST"); Pkg.build("OpenFST")

julia> # the sheep language: ba, baa, baaa, ...

julia> # start state is 0, accept states are [3], alphabet is {a,b}

julia> sheep = StdVectorFst(0, [(0, 1, :b), (1, 2, :a), (2, 3, :a), (3, 3, :a)], [3], Dict(:a => 1, :b => 2))
StdVectorFst(4 state(s))

julia> OpenFST.growth(sheep) # number of words
OpenFST.growth(sheep)
10-element Vector{BigInt}:
0
0
0
1
1
1
1
1
1
1

julia> sheepsheep = concat(sheep,sheep) # concatenation: baba, baaba, babaa, ...
StdVectorFst(8 state(s))

julia> OpenFST.growth(sheepsheep)
10-element Vector{BigInt}:
0
0
0
0
0
0
1
2
3
4

julia> sheepsheepsheep |> determinize |> minimize
StdVectorFst(9 state(s))

julia> (initial, transitions, accepting) = unpack(ans)
(0, [(0, 1, ), (1, 2, :b), (2, 3, :a), (3, 4, :a), (4, 5, ), (4, 4, :a), (5, 6, :b), (6, 7, :a), (7, 8, :a), (8, 8, :a)], [4, 8])
```
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CxxWrap, Libdl

openfstver = "openfst-1.8.2"
openfstver = "openfst-1.8.3"
openfstdir = "$(@__DIR__)/$openfstver/"

run(`tar xfz $(@__DIR__)/$openfstver.tar.gz -C $(@__DIR__)`)
Expand Down
Binary file removed deps/openfst-1.8.2.tar.gz
Binary file not shown.
12 changes: 6 additions & 6 deletions deps/openfst-1.8.2.patch → deps/openfst-1.8.3.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -ur openfst-1.8.2-orig/src/include/fst/log.h openfst-1.8.2/src/include/fst/log.h
--- openfst-1.8.2-orig/src/include/fst/log.h 2022-02-03 17:48:58.000000000 +0100
+++ openfst-1.8.2/src/include/fst/log.h 2022-09-08 10:19:17.000000000 +0200
diff -ur openfst-1.8.3-orig/src/include/fst/log.h openfst-1.8.3/src/include/fst/log.h
--- openfst-1.8.3-orig/src/include/fst/log.h 2022-02-03 17:48:58.000000000 +0100
+++ openfst-1.8.3/src/include/fst/log.h 2022-09-08 10:19:17.000000000 +0200
@@ -29,18 +29,20 @@

DECLARE_int32(v);
Expand All @@ -25,9 +25,9 @@ diff -ur openfst-1.8.2-orig/src/include/fst/log.h openfst-1.8.2/src/include/fst/

private:
bool fatal_;
diff -ur openfst-1.8.2-orig/src/lib/util.cc openfst-1.8.2/src/lib/util.cc
--- openfst-1.8.2-orig/src/lib/util.cc 2022-02-03 17:48:58.000000000 +0100
+++ openfst-1.8.2/src/lib/util.cc 2022-09-08 09:18:28.000000000 +0200
diff -ur openfst-1.8.3-orig/src/lib/util.cc openfst-1.8.3/src/lib/util.cc
--- openfst-1.8.3-orig/src/lib/util.cc 2022-02-03 17:48:58.000000000 +0100
+++ openfst-1.8.3/src/lib/util.cc 2022-09-08 09:18:28.000000000 +0200
@@ -37,6 +37,8 @@
"FST errors are fatal; o.w. return objects flagged as bad: "
"e.g., FSTs: kError property set, FST weights: not a Member()");
Expand Down
Binary file added deps/openfst-1.8.3.tar.gz
Binary file not shown.

2 comments on commit 7a1715c

@laurentbartholdi
Copy link
Owner Author

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 updated: JuliaRegistries/General/110928

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>" 7a1715cfeb3d0c5211a84ab7b4be577a0744bd2a
git push origin v0.1.1

Also, note the warning: This looks like a new registration that registers version 0.1.1.
Ideally, you should register an initial release with 0.0.1, 0.1.0 or 1.0.0 version numbers
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.