í is a vowel
This commit is contained in:
parent
22836a9206
commit
ac234aec2a
1 changed files with 14 additions and 12 deletions
|
|
@ -30,8 +30,8 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
val REGEX_PARSE_META = Regex("\\|(?=[a-z]:)")
|
||||
val REGEX_LYRICS_COMMENT = Regex("\\$\\{([^\\}]:([^\\}]*))\\}|\\$\\{R!\\}")
|
||||
val REGEX_LYRICS_REPETITION = Regex("_(\\d)")
|
||||
val REGEX_VOWELS_STAGE1 = Regex("[aeiouyòàéỳ](?![,;\\.\\-:!\\?\\}»_\"]*([ aeiouyòàéỳ/]|_[1-9]))", RegexOption.IGNORE_CASE)
|
||||
val REGEX_VOWELS_STAGE2 = Regex("(?<=[aeiouyòàéỳ])_([,;\\.\\-:!\\?\\}»_\"]+)", RegexOption.IGNORE_CASE)
|
||||
val REGEX_VOWELS_STAGE1 = Regex("[aeiouyòàéìỳ](?![,;\\.\\-:!\\?\\}»_\"]*([ aeiouyòàéìỳ/]|_[1-9]))", RegexOption.IGNORE_CASE)
|
||||
val REGEX_VOWELS_STAGE2 = Regex("(?<=[aeiouyòàéìỳ])_([,;\\.\\-:!\\?\\}»_\"]+)", RegexOption.IGNORE_CASE)
|
||||
val REGEX_VOWELS_STAGE3 = Regex("_([\\?\\!:,;\\.»\\)]+)")
|
||||
val REGEX_MALAGASY_MN = Regex("([aeio])_([nm])([tdjkbp])")
|
||||
val REGEX_MALAGASY_MN_STAGE2 = Regex("_([mn])-")
|
||||
|
|
@ -288,16 +288,8 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
// Les lignes de type N seront parsées à la fin. preloadN() se chargera d'abord de réarranger la ligne
|
||||
// pour bien gérer les parenthèses.
|
||||
unparsedNote.add(index.toString()+value)
|
||||
"M" -> {
|
||||
val metaChunks: List<String> = value.split(REGEX_PARSE_META)
|
||||
metaChunks.forEach { parseMeta(it) }
|
||||
parseMeta(value)
|
||||
sharedScreenModel.setMeasure(meta["m"] ?: "")
|
||||
sharedScreenModel.setSongTitle(meta["t"] ?: "")
|
||||
sharedScreenModel.setSongAuthor(meta["a"] ?: "")
|
||||
sharedScreenModel.setSongComposer(meta["h"] ?: "")
|
||||
sharedScreenModel.setSongRhythm(meta["r"] ?: "")
|
||||
}
|
||||
"M" ->
|
||||
loadM(value)
|
||||
"L" ->
|
||||
loadL(index, value)
|
||||
"Y" ->
|
||||
|
|
@ -340,6 +332,16 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
|||
|
||||
}
|
||||
}
|
||||
private fun loadM(value: String) {
|
||||
val metaChunks: List<String> = value.split(REGEX_PARSE_META)
|
||||
metaChunks.forEach { parseMeta(it) }
|
||||
parseMeta(value)
|
||||
sharedScreenModel.setMeasure(meta["m"] ?: "")
|
||||
sharedScreenModel.setSongTitle(meta["t"] ?: "")
|
||||
sharedScreenModel.setSongAuthor(meta["a"] ?: "")
|
||||
sharedScreenModel.setSongComposer(meta["h"] ?: "")
|
||||
sharedScreenModel.setSongRhythm(meta["r"] ?: "")
|
||||
}
|
||||
private fun loadN(voiceNumber: Int, line: String) {
|
||||
val newN = POneVoiceNote()
|
||||
val lineRepeated = REGEX_REPETITION.replace(line) { matchResult ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue