## Appendix B  
Algorithm A1 shows the pseudocode for character error rate (CER), word error rate (WER), and space-normalized word error rate (sWER), which we propose as the new evaluation metric for Korean. In Korean, space rules are flexible. This means that even though they hear the same utterance, spaces may be used differently for each person writing the transcription. However, this causes a problem in the evaluation of speech recognition because the hypothesis text with inconsistent spaces is not a problem for humans to read, but it is considered an invalid word in the evaluation metric. For this reason, we generated a space-normalized hypothesis text and then calculated the evaluation metric from it. Algorithm A2 provides the pseudocode for generating the space-normalized word units-based hypothesis text. Here, Algorithm A2 was created by modifying the Levenshtein distance provided by the Kaldi toolkit [40], and we did not consider memory efficiency or code simplification. ```
1:Character-level reference and hypothesis texts (\(ref\_char\_hyp\_char\))
2:Character, word, & space-normalized word error rates
3:functioncalculate_scores(\(ref\_char\_hyp\_char\))
4://check the number of lines in two texts
5:if length(\(ref\_char\))!= length(\(hyp\_char\)) then
6:return report_error
7:
8://get word-level texts
9:\(ref\_word\leftarrow\)char_to_word(\(ref\_char\))
10:\(hyp\_word\leftarrow\)char_to_word(\(hyp\_char\))
11:
12:
13://get word-spacing normalized texts
14:\(ref\_word_{norm}\), \(hyp\_word_{norm}=\)[], []
15:for each\(ref\), \(hyp\)in (\(ref\_char\), \(hyp\_char\)) do
16:\(ref\_char_{norm}\), \(hyp\_char_{norm}=\)get_norm_text(\(ref,hyp\))
17:\(ref\_word_{norm}\leftarrow\)push(char_to_word(\(ref\_char_{norm}\)))
18:\(hyp\_word_{norm}\leftarrow\)push(char_to_word(\(hyp\_char_{norm}\)))
19:
20://compute CER, WER, and sWER with the sclite toolkit
21:\(CER\leftarrow\)sclite(\(ref\_char\), \(hyp\_char\))
22:\(WER\leftarrow\)sclite(\(ref\_word\), \(hyp\_word\))
23:\(sWER\leftarrow\)sclite(\(ref\_word_{norm}\), \(hyp\_word_{norm}\))
24:return(\(CER\), \(WER\), sWER);
```  
**Algorithm A1**. Calculation of CER, WER, & sWER (%)```
1:Reference and hypothesis texts (_ref_, _hyp_)
2:Word-spacing normalized texts (_ref_norm_, _hyp_norm_)
3:functionget_norm_text(_ref_, _hyp_)
4://do character-level tokenizing with space symbol (_'_')
5://ref: \"_C\({}_{1}\)C\({}_{2}\)_C\({}_{3}\)\" \(\rightarrow\) refs: ['_C\({}_{1}\)','_C\({}_{2}\)','_C\({}_{3}\)']
6:refs, _hyps_\(\leftarrow\)char_tokenizing(_ref_),char_tokenizing(_hyp_)
7:rlen, _hlen_\(\leftarrow\) length of _refs_ and _hyps_
8://initialization
9:scores \(\leftarrow\) zeros (_hlen_+1, _rlen_+1)
10:for\(r=0\) to rlendo\(\textit{scores}_{0,r}=\);
11:for\(h=1\) to lhen do
12:\(\textit{scores}_{h,0}=\textit{scores}_{h-1,0}+1\)
13:for\(j=1\) to rlendo
14:\(hyp_{\textit{nasp}}\), \(ref_{\textit{nasp}}=\) remove_space_symbol(_hyp_\({}_{h-1}\), _ref_\({}_{-1}\))
15:\(\textit{sub\_or\_cor}=\textit{scores}_{h-1,r-1}+(hyp_{\textit{nasp}}==\textit{ ref}_{\textit{nasp}}\)? 0:1)
16:\(\textit{ints}\), \(\textit{del}=\textit{scores}_{h-1,r}+1\), \(\textit{scores}_{h,r-1}+1\)
17:\(\textit{scores}_{h,r}=\)min(_sub_or_, _ors_, _ins_, _del_)
18://traceback and compute alignment
19:\(h\), \(r\) = _hlen_, _rlen_
20:\(ref_{\textit{norm}}\), \(hyp_{\textit{norm}}=\) [], []
21:while\(h>0\) or \(r>0\)do
22:if\(h==0\)then = \(h\); last_r = \(r-1\);
23:elseif\(r==0\)then last_h = \(h-1\); last_r = \(r\);
24:else
25:\(hyp_{\textit{nasp}}\), \(ref_{\textit{nasp}}=\) remove_space_symbol(_hyp_\({}_{h-1}\), _ref_\({}_{-1}\))
26:\(\textit{sub\_or\_cor}=\textit{scores}_{h-1,r-1}+(hyp_{\textit{nasp}}==\textit{ ref}_{\textit{nasp}}\)?