unhardcode plural grammar
This commit is contained in:
parent
83741f0cd1
commit
49d2154dc1
|
@ -17,7 +17,7 @@ copy it into your gemini directory and make it executable of course
|
|||
* [X] add another file for pronouns instead of having them hardcoded.
|
||||
|
||||
* unhardcode [opened: 2022-05-31T13:32:00Z]
|
||||
* [ ] instead of hardcoding they for plural detection, put that into the csv file
|
||||
* [X] instead of hardcoding they for plural detection, put that into the csv file
|
||||
|
||||
## Changelog
|
||||
* 2021-10-18: thrown together in an hour
|
||||
|
@ -34,3 +34,4 @@ copy it into your gemini directory and make it executable of course
|
|||
* 2022-07-30: provide a back link
|
||||
* 2022-09-18: fix issue where every pronoun set was regarded as unknown
|
||||
* 2022-09-18: provide link to repository
|
||||
* 2022-09-18: unhardcode plural grammar
|
||||
|
|
|
@ -29,6 +29,7 @@ pr_obj=( $(tail -n +2 pronouns.csv | cut -d ',' -f2) )
|
|||
pr_psd=( $(tail -n +2 pronouns.csv | cut -d ',' -f3) )
|
||||
pr_pos=( $(tail -n +2 pronouns.csv | cut -d ',' -f4) )
|
||||
pr_ref=( $(tail -n +2 pronouns.csv | cut -d ',' -f5) )
|
||||
pr_plr=( $(tail -n +2 pronouns.csv | cut -d ',' -f6) )
|
||||
|
||||
cnt=0
|
||||
|
||||
|
@ -69,10 +70,8 @@ for i in "${pr_sub[@]}"; do
|
|||
for j in "${sentences[@]}"; do
|
||||
cursent="${j}"
|
||||
|
||||
if [[ "${pr_sub[${cnt}]}" == "they" ]]; then
|
||||
if [[ "${pr_plr[${cnt}]}" -eq 1 ]]; then
|
||||
cursent="${cursent//MSHAS/have}"
|
||||
else
|
||||
cursent="${cursent//MSHAS/has}"
|
||||
fi
|
||||
|
||||
cursent="${cursent//MSHAS/has}"
|
||||
|
|
10
pronouns.csv
10
pronouns.csv
|
@ -1,5 +1,5 @@
|
|||
Subjective,Objective,PosessiveDeterminative,Posessive,Reflexive
|
||||
he,him,his,his,himself
|
||||
she,her,her,hers,herself
|
||||
they,them,their,theirs,themselves
|
||||
xe,xem,xyr,xyrs,xemself
|
||||
Subjective,Objective,PosessiveDeterminative,Posessive,Reflexive,Plural Grammar
|
||||
he,him,his,his,himself,0
|
||||
she,her,her,hers,herself,0
|
||||
they,them,their,theirs,themselves,1
|
||||
xe,xem,xyr,xyrs,xemself,0
|
|
Loading…
Reference in New Issue