@@ -69,13 +69,22 @@ pub(crate) fn is_english_symbol(symbol: char) -> bool {
6969/// 단일 소문자 단어가 연속될 때 연속표가 필요한지 판단한다.
7070/// [통일 영어 점자 - 5.2 1급 점자 기호표(⠰)] : 글자 a, i, o 앞에는 1급 점자 기호표가 필요하지 않다.
7171pub ( crate ) fn requires_single_letter_continuation ( letter : char ) -> bool {
72- letter. is_ascii_lowercase ( ) && !matches ! ( letter, 'a' | 'i' | 'o' )
72+ letter. is_ascii_alphabetic ( ) && !matches ! ( letter. to_ascii_lowercase ( ) , 'a' | 'i' | 'o' )
7373}
7474
7575fn is_ascii_letter_or_digit ( ch : Option < char > ) -> bool {
7676 ch. is_some_and ( |c| c. is_ascii_alphanumeric ( ) )
7777}
7878
79+ fn is_digital_notation_symbol ( symbol : char ) -> bool {
80+ matches ! ( symbol, '/' | '@' | '#' | '.' | '_' | ':' )
81+ }
82+
83+ fn has_digital_notation_signature ( word_chars : & [ char ] ) -> bool {
84+ let text: String = word_chars. iter ( ) . collect ( ) ;
85+ text. contains ( "//" ) || text. contains ( '@' ) || text. contains ( '#' ) || text. contains ( '_' )
86+ }
87+
7988pub ( crate ) fn prev_ascii_letter_or_digit ( word_chars : & [ char ] , index : usize ) -> bool {
8089 let mut j = index;
8190 while j > 0 {
@@ -167,10 +176,31 @@ pub(crate) fn should_render_symbol_as_english(
167176
168177 prev_ascii && next_ascii
169178 }
179+ '/' | '@' | '#' | '.' | '_' | ':' | '-' => {
180+ let prev_ascii = prev_ascii_letter_or_digit ( word_chars, index) ;
181+ let next_ascii = next_ascii_letter_or_digit ( word_chars, index, remaining_words) ;
182+
183+ ( prev_ascii && next_ascii)
184+ || ( symbol == '/' && prev_char == Some ( '/' ) && next_ascii)
185+ || ( symbol == '/' && next_char == Some ( '/' ) && prev_ascii)
186+ }
170187 _ => false ,
171188 }
172189}
173190
191+ pub ( crate ) fn should_keep_english_mode_for_symbol (
192+ symbol : char ,
193+ word_chars : & [ char ] ,
194+ index : usize ,
195+ remaining_words : & [ & str ] ,
196+ ) -> bool {
197+ if !is_digital_notation_symbol ( symbol) || !has_digital_notation_signature ( word_chars) {
198+ return false ;
199+ }
200+
201+ should_render_symbol_as_english ( true , true , & [ ] , symbol, word_chars, index, remaining_words)
202+ }
203+
174204#[ cfg( test) ]
175205mod tests {
176206 use super :: * ;
0 commit comments