gender is optional
This commit is contained in:
parent
195dc16f3d
commit
bec968ac26
2 changed files with 8 additions and 8 deletions
|
|
@ -2136,12 +2136,12 @@ fn si_pron() -> HashMap<String, HashMap<String, HashMap<String, String>>> {
|
|||
si_pron
|
||||
}
|
||||
|
||||
pub fn get_si_pron(thecase: &str, word: &str, gender: &str) -> String {
|
||||
pub fn get_si_pron(thecase: &str, word: &str, gender: Option<&str>) -> String {
|
||||
match si_pron().get(thecase) {
|
||||
Some(case) =>
|
||||
match case.get(word) {
|
||||
Some(sing) =>
|
||||
match sing.get(gender) {
|
||||
match sing.get(gender.unwrap_or("N/A")) {
|
||||
Some(specific) => specific.clone(),
|
||||
None => sing.clone().values().next().unwrap().clone(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue