Skip to content

Commit 3caf530

Browse files
committed
update
1 parent d098c0a commit 3caf530

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

docs/src/man/rhythmic_analysis.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The prevalence of poetry in Arabic literature necessitates scientific tool to st
66
The first data is from a well known author, [Al-Mutanabbi المتنبّي](https://en.wikipedia.org/wiki/Al-Mutanabbi), who authored several poetry including the titled [*'Indeed, every woman with a swaying walk'*](https://www.youtube.com/watch?v=9c1IrQwfYFM), which will be the basis for this section.
77
## Loading Data
88
The following codes assigns the said poem of Al-Mutanabbi to a variable poem.
9-
```@example abc
9+
```julia
1010
using Yunir
1111
@transliterator :default
1212

@@ -69,19 +69,19 @@ poem = """
6969
```
7070
## Extracting Syllables
7171
Now let's try extracting the syllables for the first line. To do this, let's convert the text into a vector of stanzas of the poem. We therefore split the text on the `";\n"` separator, where the `\n` is the code for line break. The function `strip` simply removes the whitespaces before and after each stanza.
72-
```@example abc
72+
```julia
7373
texts = map(x -> strip(string(x)), split.(poem, "\n"))
7474
```
7575
Next is to initialize the syllabification for each stanza, suppose we want to capture the consonant before and after each vowel to represent one syllable. For example, for the word `basmala`, the syllabification if only the consonant preceding the vowel is considered then we have `ba`, `ma`, and `la`. To specify this configuration for the syllable, we do it as follows:
76-
```@repl abc
76+
```julia
7777
syllable = Syllable(1, 0, 3)
7878
```
7979
Here the first argument represents the number of characters prior to the vowel is considered, the next argument which is 0 is the number of character after the vowel, and 3 in the third argument simply mean how many vowels do we need to capture for each word. So that,
80-
```@repl abc
80+
```julia
8181
r = Syllabification(false, syllable)
8282
```
8383
Then, the following will syllabicize the first word in the said poem.
84-
```@repl abc
84+
```julia
8585
r(
8686
string(split(texts[1], " ")[1]),
8787
isarabic=true,
@@ -95,8 +95,8 @@ From the output above, there are two syllables, the first being `أَ` and the s
9595
!!! warning "Caution"
9696
It is important to note that syllabification works only on a fully diacritize text as in the input poem here, and that is because each syllable contain a vowel. If not fully diacritize, then the syllabification will consider a syllable with only consonant and no vowel.
9797

98-
So that, if we want to extract the syllables of the first three lines, then:
99-
```@example abc
98+
So that, if we want to extract the syllables of\ the first three lines, then:
99+
```julia
100100
# Process only the first 3 lines for demonstration
101101
line_syllables = Array[]
102102
for line in texts[1:3]
@@ -118,7 +118,7 @@ for line in texts[1:3]
118118
end
119119
```
120120
To extract the syllables of the words in first line of the poem, we run the following code:
121-
```@example abc
121+
```julia
122122
line_syllables[1]
123123
```
124124
## References

nb/quran-rhythmic/code1.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,6 @@ for line in texts
8282
end
8383
push!(line_syllables, word_syllables)
8484
end
85+
86+
texts[1]
8587
line_syllables[1]

0 commit comments

Comments
 (0)