Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Korean: clarify FKR172÷179 #65

Closed
scossu opened this issue Nov 6, 2023 · 9 comments
Closed

Korean: clarify FKR172÷179 #65

scossu opened this issue Nov 6, 2023 · 9 comments
Milestone

Comments

@scossu
Copy link
Collaborator

scossu commented Nov 6, 2023

@hyoungl I need some help clarifying what's happening in https://github.com/lcnetdev/scriptshifter/blob/main/legacy/Functions_KoreanHancha.au3#L241-L256 (repeated for FKR172 to 179 with different characters - comments are mine):

   ;FKR172
   If StringInStr($Hangul,"列")>0 THEN
	  StringReplace($Hangul,"列","X")
	  $R_Initial_Count = @Extended
          ; ^^ This gets the number of occurrences of "列"
	  For $i=1 to $R_Initial_Count
          ; ^^ loops for as many occurrences are found
		 $R_Initial_Str = StringMid($Hangul,StringInStr($Hangul,"列",0,1)-1,1)
                 ; ^^ This looks like is extracting one character before the current "列", right?
		 ClipPut($R_Initial_Str)
		 IdentifyCoda()
                 ; ^^ identifyCoda returns the modulo of the ASCII value of the character before "列" minus 44032, and 28
		 $CodaValue = ClipGet()
		 If $CodaValue = "0" OR $CodaValue = "4" OR StringToBinary($R_Initial_Str,4)<100 Then
                 ; ^^ What does StringToBinary? I looked at the AutoIt doc and examples online but I'm not sure how that can be compared with an integer (100). Would 100 be the code point value?
			$Hangul=StringReplace($Hangul,"列","열",1)
		 Else
			$Hangul=StringReplace($Hangul,"列","렬",1)
		 EndIf
                 ; These replacements ensure that the next loop looks for the next occurrence of "列"
	  Next
   EndIf

Thanks.

@hyoungl
Copy link
Collaborator

hyoungl commented Nov 6, 2023

Those characters have two different readings depending on the value of the previous coda. You can collapse them into one, if you want to. I just wrote one function for one character, and then simply did copy-and-paste for all the others.

@scossu
Copy link
Collaborator Author

scossu commented Nov 7, 2023

Thanks for confirming. I mainly wanted to clarify what StringToBinary is meant to yield. Since the string being passed is only one character, it should be the numeric code point value of the character, compared to an integer (100 would be the value of the letter d), correct?

@hyoungl
Copy link
Collaborator

hyoungl commented Nov 9, 2023

That is basically to decide what the previous character is in front of 烈.
I don't remember why I put StringToBinary in there, but maybe in case where the previous character is a symbol or punctuation?

@scossu
Copy link
Collaborator Author

scossu commented Nov 15, 2023

What would StringToBinary yield for, e.g. , and how would it compare to 100?

I'm not sure if I'm using the correct function in my module and I'm unable to test on AutoIt because I'm not on Windows. In my Python code would yield 44053.

@hyoungl
Copy link
Collaborator

hyoungl commented Nov 20, 2023

$CodaValue = "0" means no coda. The syllable is composed of a consonant and a vowel.
$CodaValue = "4" means the coda is "ㄴ" = n.
As for StringToBinary($R_Initial_Str,4)<100, I think I added that for the case where a symbol comes in front of the character.

@hyoungl
Copy link
Collaborator

hyoungl commented Nov 20, 2023

In short, the purpose of that part is to find if the immediately preceding sound is a vowel, or [n], or nothing.

@scossu
Copy link
Collaborator Author

scossu commented Nov 21, 2023

I'm still not clear on what value StringToBinary would yield that can be compared with an integer.

What would be the result of StringToBinary($R_Initial_Str,4) for $R_Initial_Str = "강"?

@hyoungl
Copy link
Collaborator

hyoungl commented Nov 21, 2023

강 will be 44053.

@scossu
Copy link
Collaborator Author

scossu commented Nov 22, 2023

Thanks, my implementation is correct then.

@scossu scossu closed this as completed Nov 22, 2023
@scossu scossu added this to the Phase 2 milestone Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants