Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/honza/osis
A golang library for parsing OSIS values to English
https://github.com/honza/osis
Last synced: about 5 hours ago
JSON representation
A golang library for parsing OSIS values to English
- Host: GitHub
- URL: https://github.com/honza/osis
- Owner: honza
- License: apache-2.0
- Created: 2019-11-15T12:47:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-24T13:42:00.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T09:14:05.346Z (5 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
osis
====A Golang library for parsing OSIS values into English
Usage
-----This library exposes two functions, `Format`, and `FormatMany`.
### Format
`Format` takes a string, and returns a formatted string and an error
### FormatMany
`FormatMany` takes a string, and returns a slice of formatted strings and an
error. It expects a string like `"John.3.16,Ps.1.1"`.```golang
package mainimport (
"fmt"
"github.com/honza/osis"
)func main() {
english, err := osis.Format("John.3.16")
if err != nil {
log.Fatal(err)
}fmt.Println(english) // "John 3:16"
}
```Supported values
----------------* `Ps` (whole book)
* `Rom.8` (chapter)
* `John.3.16` (single verse)
* `Jude.1.1` (single verse in a single chapter book)
* `Gen.1-Gen.2` (multiple chapters in one book)
* `Gen.1.1-Gen.1.2` (verse range in the same book)
* `Ps.1.1` (psalms are special)
* `Ps.1-Ps.2` (pluralize if multiple)
* `John.7.53-John.8.11` (range over multiple chapters ina single book)
* `Luke.12-Acts.1` (chapter range across books)
* `Luke.12.1-Acts.1.1` (verse range over multiple books)License
-------Apache 2.0