Documentation ¶
Overview ¶
Package quranize provides Go representation of Alquran. Original source of Alquran is taken from http://tanzil.net in XML format.
This package can transform alphabet into arabic using fast and efficient algorithm: suffix-tree for indexing and dynamic programming for parsing.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
Location represents a location in Quran.
func NewLocation ¶ added in v1.2.0
NewLocation returns new Location given sura number, aya number, and "word index" (assuming aya is splitted word by word using separator " ").
func (Location) GetWordIndex ¶ added in v1.2.0
GetWordIndex returns word index of this location.
type Quran ¶
type Quran struct { Suras []struct { Name string `xml:"name,attr"` Ayas []struct { Text string `xml:"text,attr"` } `xml:"aya"` } `xml:"sura"` }
Quran stores information of every sura and aya. It has suffix-tree index.
func NewIDIndonesian ¶
func NewIDIndonesian() Quran
NewIDIndonesian returns new Quran instance using corpus:
corpus.IDIndonesianXML
See https://github.com/alpancs/quranize/blob/master/corpus/id_indonesian.go#L4.
func NewIDMuntakhab ¶
func NewIDMuntakhab() Quran
NewIDMuntakhab returns new Quran instance using corpus:
corpus.IDMuntakhabXML
See https://github.com/alpancs/quranize/blob/master/corpus/id_muntakhab.go#L4.
func NewQuranSimpleClean ¶
func NewQuranSimpleClean() Quran
NewQuranSimpleClean returns new Quran instance using corpus:
corpus.QuranSimpleCleanXML
See https://github.com/alpancs/quranize/blob/master/corpus/quran_simple_clean.go#L4.
func NewQuranSimpleEnhanced ¶
func NewQuranSimpleEnhanced() Quran
NewQuranSimpleEnhanced returns new Quran instance using corpus:
corpus.QuranSimpleEnhancedXML
See https://github.com/alpancs/quranize/blob/master/corpus/quran_simple_enhanced.go#L4.
func ParseQuran ¶
ParseQuran returns Quran from given raw.
type Quranize ¶
type Quranize struct {
// contains filtered or unexported fields
}
Quranize encodes arabic into alphabet.
func NewDefaultQuranize ¶
func NewDefaultQuranize() Quranize
NewDefaultQuranize returns new Quranize using default mapping and quran "quran-simple-clean.xml".
Mapping: https://github.com/alpancs/quranize/blob/master/corpus/arabic_to_alphabet_clean.go#L3
Quran: https://github.com/alpancs/quranize/blob/master/corpus/quran_simple_clean.go#L4
func NewQuranize ¶
func NewQuranize(t Transliteration, q Quran) Quranize
NewQuranize return new Quranize using Transliteration t and Quran q.
type Transliteration ¶
type Transliteration struct {
// contains filtered or unexported fields
}
Transliteration helps Quranize to encode arabic into alphabet.
func NewDefaultTransliteration ¶
func NewDefaultTransliteration() Transliteration
NewDefaultTransliteration returns new Transliteration using default mapping.
Mapping: https://github.com/alpancs/quranize/blob/master/corpus/arabic_to_alphabet_clean.go#L3
func NewTransliteration ¶
func NewTransliteration(raw string) Transliteration
NewTransliteration returns new Transliteration.