Skip to content

Commit

Permalink
Merge pull request #5 from ModelTC/docs
Browse files Browse the repository at this point in the history
Update documents and CI
  • Loading branch information
ChieloNewctle authored Oct 13, 2023
2 parents 3473aa6 + a96563e commit c723e4b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 53 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cargo Build & Test

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v3
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose
- run: cargo test --verbose
54 changes: 2 additions & 52 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0](https://github.com/ModelTC/general-sam/releases/tag/v0.1.0) - 2023-10-13

### Fixed
- fix interface
- fix stub

### Other
- add release-plz.yml
- add dependabot.yml
- update readme
- add licenses info in readme
- add documentation url to Cargo.toml
- update readme
- update tests and readme usage
- update cargo settings
- add readme to pybind
- add python tests
- add order related interfaces
- add state copy interface
- rename interface
- update readme
- add readme, update examples
- update tests and docstring
- add get_trans for SAM, update python stub
- add token healing
- utf8 or unicode
- update pyo3
- export other class in the extension
- update __init__.py
- add construct_trie_from_strings
- update stub
- add get_suffix_parent_id
- add trie_utils
- minor fix
- update interfaces
- cooler traveling
- update interfaces
- a little more idiomatic
- add pybind
- remove pyo3
- add interfaces
- move out tests, add sort utils
- add insert to trie
- minor update for sam
- better naming for IterAsChain
- use Clone rather than Copy
- heal my back
- more type gymnastics, which breaks my back
- type gymnastics
- init
- add licenses
### Added
- Initial repository.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
A general suffix automaton implementation in Rust.

Python bindings and some utilities are also available.
Please check out [`pybind`](./pybind/).
Please check out [`general-sam-py`](https://github.com/ModelTC/general-sam-py).

| [![the suffix automaton of abcbc][sam-of-abcbc]][sam-oi-wiki] |
| :----------------------------------------------------------------------------: |
Expand Down
5 changes: 5 additions & 0 deletions src/trie_alike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub enum TravelEvent<NodeType, KeyType> {
Pop(NodeType),
}

/// This trait provides the essential interfaces required by `GeneralSAM`
/// to construct a suffix automaton from structures that form a prefix tree.
pub trait TrieNodeAlike {
type InnerType;
type NextStateIter: Iterator<Item = (Self::InnerType, Self)>;
Expand Down Expand Up @@ -56,6 +58,9 @@ pub trait TrieNodeAlike {
}
}

// This struct implements `TrieNodeAlike` for any iterator.
//
// It can be used to construct a suffix automaton directly from a sequence.
pub struct IterAsChain<Iter: Iterator> {
iter: Iter,
val: Option<Iter::Item>,
Expand Down

0 comments on commit c723e4b

Please sign in to comment.