@@ -58,20 +58,20 @@ add_id_and_short <- function(pd) {
58
58
verify_str_txt <- function (pd_with_terminal_text , text ) {
59
59
string_ind <- pd_with_terminal_text $ token == " STR_CONST"
60
60
strings <- pd_with_terminal_text [string_ind ,]
61
- parent_ind <- pd_with_terminal_text $ id %in% strings $ parent
62
- other_ind <- ! (string_ind | parent_ind )
61
+ parent_of_strings_ind <- pd_with_terminal_text $ id %in% strings $ parent
62
+ other_ind <- ! (string_ind | parent_of_strings_ind )
63
63
if (nrow(strings ) == 0 || ! any(substr(strings $ text , 1 , 1 ) == " [" )) {
64
64
return (pd_with_terminal_text )
65
65
}
66
66
pd_with_all_text <- get_parse_data(text , include_text = TRUE )
67
- parents <- pd_with_all_text [parent_ind , c(" id" , " text" , " short" )]
67
+ parent_of_strings <- pd_with_all_text [parent_of_strings_ind , c(" id" , " text" , " short" )]
68
68
strings $ text <- NULL
69
69
strings $ short <- NULL
70
- new_strings <- merge(strings , parents , by.x = " parent" , by.y = " id" )
70
+ new_strings <- merge(strings , parent_of_strings , by.x = " parent" , by.y = " id" )
71
71
bind_rows(
72
72
new_strings ,
73
73
pd_with_terminal_text [other_ind , ],
74
- pd_with_terminal_text [parent_ind ,]
74
+ pd_with_terminal_text [parent_of_strings_ind ,]
75
75
) %> %
76
76
arrange(pos_id )
77
77
0 commit comments