/media/bill/PROJECTS/Qnial/code develop_test/z_180903 symExtract, conversion to str_stdForm and typechanges within strings.txt 03Sep2018 symTrans_lineType - change symbols, convert to within-str changes, and improve symbols systems Changing from line to in-line resetting of symTrans_lineType Now in "symbols system loaddefs.ndf" : Change : +-----+ # symTrans_lineType : special characters at beginning of lines : # NOTE : these symbols are "persistent" until changed by a different symTrans_lineType (applies to next use of operators!!) `# comment only - no translation or extraction of symbols `$ applies 'tranList Lucas.txt' to a string `% applies 'tranList HFLN.txt' to a string # 25Jul2018 no longer used `^ applies trans_Lucas_to_HFLN to a string, new string has "%^" at start of line to help editing `& applies trans_HFLN_to_Lucas to a string, new string has "%^" at start of line to help editing +-----+ To : +-----+ # symTrans_lineType : special characters at beginning of lines : # NOTE : these symbols are "persistent" until changed by a different symTrans_lineType (applies to next use of operators!!) '/*' comment only - no translation or extraction of symbols '/$' applies 'tranList Lucas.txt' to a string '/%' applies 'tranList HFLN.txt' to a string +-----+ Change : +-----+ sym_stdForm IS OP str { LOCAL blanks chrList chrListLast i in_blanks len spc symNew ; NONLOCAL chrs_blank ; % ; chrListLast := null ; chrList := str_to_unicodeList str ; len := gage shape chrList ; i := 0 ; % ; symNew := null ; WHILE (i < len) DO IF (in chrList@i chrs_blank) THEN null ; ELSEIF (in chrList@i chrs_symbols_HFLN) THEN IF (OR (in chrListLast chrs_blank) (in chrListLast chrs_paren_stop)) THEN symNew := link symNew ' ' chrList@i ; ELSE symNew := link symNew chrList@i ; ENDIF ; ELSEIF (in chrList@i chrs_math_spaced) THEN IF (in chrListLast chrs_blank) THEN spc := null ; ELSE spc := ' ' ; ENDIF ; symNew := link symNew spc chrList@i ' ' ; ELSEIF (= chrList@i ':') THEN symNew := link symNew chrList@i ' ' ; ELSE symNew := link symNew chrList@i ; ENDIF ; chrListLast := last symNew ; i := i + 1 ; ENDWHILE ; % ; symNew } +-----+ To : +-----+ # 03Sep2018 NOTE : sym_stdForm RETAINS comments - OK for now sym_stdForm IS OP str { LOCAL blanks chrList chrListLast i in_blanks len spc strStdForm symTrans_lineType symTrans_lineType_old ; NONLOCAL chrs_blank ; % ; chrListLast := null ; chrList := str_to_unicodeList str ; len := gage shape chrList ; i := 0 ; % ; strStdForm := null ; WHILE (i < len) DO IF (= chrList@i '/') THEN IF ((i + 1) < len) THEN IF (= chrList@(i + 1) '*') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/*' ; strStdForm := link strStdForm '/*' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '$') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/$' ; strStdForm := link strStdForm '/$' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '%') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/%' ; strStdForm := link strStdForm '/%' ; ELSEIF (= chrList@(i + 1) '^') THEN symTrans_lineType := symTrans_lineType_old ; strStdForm := link strStdForm '/%' ; symTrans_lineType_old := symTrans_lineType ; i := i + 1 ; ELSE strStdForm := link strStdForm '/' ; ENDIF ; ENDIF ; ELSEIF (in chrList@i chrs_blank) THEN null ; ELSEIF (in chrList@i chrs_symbols_HFLN) THEN IF (OR (in chrListLast chrs_blank) (in chrListLast chrs_paren_stop)) THEN strStdForm := link strStdForm ' ' chrList@i ; ELSE strStdForm := link strStdForm chrList@i ; ENDIF ; ELSEIF (in chrList@i chrs_math_spaced) THEN IF (in chrListLast chrs_blank) THEN spc := null ; ELSE spc := ' ' ; ENDIF ; strStdForm := link strStdForm spc chrList@i ' ' ; ELSEIF (= chrList@i ':') THEN strStdForm := link strStdForm chrList@i ' ' ; ELSE strStdForm := link strStdForm chrList@i ; ENDIF ; chrListLast := last strStdForm ; i := i + 1 ; ENDWHILE ; % ; strStdForm } +-----+ Change : +-----+ sym_stdForm_file IS OP pname_inn d_out { LOCAL chrSet f_inn f_out i_line i_line_old str str_out uniStr uniStr_old ; % ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_inn ; pname_out := link d_out finn_base ' stdForm.' finn_extension ; % ; IF file_exists '-f' pname_inn THEN f_inn := open pname_inn "r ; f_out := open pname_out "w ; symTrans_lineType := `# ; % at file start, assume comments ; i_line := 0 ; i_line_old := 1 ; uniStr_old := null ; WHILE (~= ??eof (str := readfile f_inn)) DO i_line := i_line + 1 ; uniStr := sym_stdForm str ; IF (OR ('=<>#$%' EACHLEFT in str)) THEN IF (in str@0 '#$%') THEN symTrans_lineType := str@0 ; ENDIF ; %write uniStr ; IF (~= null uniStr_old) THEN IF (uniStr_old@0 in '#$%') THEN chrSet := link uniStr_old@0 '..' ; ELSE chrSet := '...' ; ENDIF ; str_out := sym_stdForm (link chrSet (string i_line_old) '...' uniStr_old ) ; writefile f_out str_out ; ENDIF ; i_line_old := i_line ; IF (= `# symTrans_lineType) THEN uniStr_old := null ; ELSE uniStr_old := uniStr ; ENDIF ; ELSE IF (= `# symTrans_lineType) THEN uniStr_old := null ; ELSE uniStr_old := link uniStr_old ' ' uniStr ; ENDIF ; ENDIF ; ENDWHILE ; IF (AND (~= `# symTrans_lineType) (~= null uniStr)) THEN IF (uniStr@0 in '#$%') THEN chrSet := link uniStr@0 ' ' ; ELSE chrSet := ' ' ; ENDIF ; str_out := sym_stdForm (link chrSet ' ' (string i_line_old) ' ' uniStr_old ' ') ; writefile f_out str_out ; ENDIF ; % ; EACH close f_inn f_out ; write 'sym_stdForm_file - processing executed normally on file :' ; write link ' "' pname_inn '" ' ; l ELSE write 'sym_stdForm_file ERROR - input file is missing :' ; write link ' "' pname_inn '" ' ; o ENDIF } +-----+ To : +-----+ # 03Sep2018 NOTE : if a complete expression is formed of '=<>', then subsequent line are appended - OK for now sym_stdForm_file IS OP flag_symDebug pname_inn d_out { LOCAL chrSet f_inn f_out i_line i_line_old str str_old str_stdForm symTrans_lineType ; % ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_inn ; pname_out := link d_out finn_base ' stdForm.' finn_extension ; % ; IF file_exists '-f' pname_inn THEN f_inn := open pname_inn "r ; f_out := open pname_out "w ; symTrans_lineType := '/*' ; % at file start, assume comments ; i_line := 0 ; i_line_old := 1 ; str_old := null ; WHILE (~= ??eof (str := readfile f_inn)) DO i_line := i_line + 1 ; str_stdForm := sym_stdForm str ; %write str_stdForm ; IF (OR ('=<>' EACHLEFT in str)) THEN IF flag_symDebug THEN writefile f_out (link (string i_line_old) '...' str) ; ELSE writefile f_out str_old ; ENDIF ; str_old := str_stdForm ; i_line_old := i_line ; ELSE str_old := link str_old ' ' str_stdForm ; ENDIF ; ENDWHILE ; IF (~= i_line i_line_old) THEN str_old := link str_old str_stdForm ; ENDIF ; IF flag_symDebug THEN writefile f_out (link (string i_line_old) '...' str) ; ELSE writefile f_out str_old ; ENDIF ; % ; EACH close f_inn f_out ; write 'sym_stdForm_file - processing executed normally on file :' ; write link ' "' pname_inn '" ' ; % ; ELSE write 'sym_stdForm_file ERROR - input file is missing :' ; write link ' "' pname_inn '" ' ; ENDIF ; } +-----+ Change : +-----+ symExtract_stringPosn IS OP str { LOCAL chrList dim_flags flags i jump len n_paren posnList symExStr_List symParenList symList symNew ; NONLOCAL chrs_symbols_HFLN chrs_paren_stop chrs_paren_strt symExtract_decisionTable symExtractString_recurLevel symExtractString_recurLevel_max ; % ; symExtractString_recurLevel := symExtractString_recurLevel + 1 ; %write link 'symExtractString_recurLevel: ' (string symExtractString_recurLevel) ; %stops recursive callS ; IF (isstring str) THEN % ; blanks := link chrs_blank ; symNew := '' ; symList := null ; posnList := null ; dim_flags := gage shape shape symExtract_decisionTable ; flags := dim_flags reshape 0 ; n_paren := 0 ; chrList := str_to_unicodeList str ; len := gage shape chrList ; in_blanks := o ; i := 0 ; % ; WHILE (i < len) DO IF (AND (NOT in_blanks) (in chrList@i chrs_blank) (= 0 flags@2)) THEN in_blanks := l ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ELSEIF (in chrList@i chrs_symbols_HFLN) THEN flags@1 := 1 ; execute symExtract_decisionTable@(flags) ; ELSEIF (in chrList@i chrs_paren_strt) THEN flags@1 := 0 ; IF (= 1 flags@0) THEN n_paren := n_paren + 1 ; flags@2 := 1 ; ENDIF ; in_blanks := o ; execute symExtract_decisionTable@(flags) ; ELSEIF (in chrList@i chrs_paren_stop) THEN flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; IF (= 1 flags@0) THEN n_paren := n_paren - 1 ; IF (0 < n_paren) THEN flags@2 := 1 ; ELSE flags@2 := 0 ; ENDIF ; ENDIF ; in_blanks := o ; % for non-[chrs_blank,chrs_symbols_HFLN,chrs_[strt,stop]_paren] characters ; ELSE in_blanks := o ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ENDIF ; i := i + 1 ; ENDWHILE ; % ; %capture the symNew at the end of the line (if there is one) ; IF (= 1 flags@0) THEN symList := link symList (solitary symNew) ; ENDIF ; symParenList := syms_inParens symList ; symExStr_pairs := EACH symExtract_stringPosn symParenList ; symExStr_List := EACH first symExStr_pairs ; symExPosn_List := EACH second symExStr_pairs ; symList := link symList (link symExStr_List) ; posnList := link posnList (link symExPosn_List) ; % ; %------------ ; %stops recursive calls ; ELSE symList := null ; %write link 'symExtractstring recurLevel null string input: ' (string symExtractString_recurLevel) ; ENDIF ; % ; symList posnList } +-----+ To : +-----+ # 03Sep2018 NOTE : symExtract_stringPosn MUST be fed a string str_sdForm to get proper symbols! symExtract_stringPosn IS OP str_stdForm { LOCAL chrList dim_flags flags i jump len n_paren posnList symExStr_List symList symNew symParenList typeList ; NONLOCAL chrs_symbols_HFLN chrs_paren_stop chrs_paren_strt symExtract_decisionTable symExtractString_recurLevel symExtractString_recurLevel_max symTrans_lineType ; % ; symExtractString_recurLevel := symExtractString_recurLevel + 1 ; %write link 'symExtractString_recurLevel: ' (string symExtractString_recurLevel) ; %stops recursive callS ; IF (isstring str_stdForm) THEN % ; blanks := link chrs_blank ; symNew := '' ; dim_flags := gage shape shape symExtract_decisionTable ; flags := dim_flags reshape 0 ; n_paren := 0 ; chrList := str_to_unicodeList str_stdForm ; len := gage shape chrList ; in_blanks := o ; i := 0 ; symList := null ; posnList := null ; typeList := null ; % ; WHILE (i < len) DO IF (= chrList@i '/') THEN IF ((i + 1) < len) THEN IF (= chrList@(i + 1) '*') THEN symTrans_lineType := '/*' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '$') THEN symTrans_lineType := '/$' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '%') THEN symTrans_lineType := '/%' ; i := i + 1 ; ELSE % treated same as ELSE in first IF ; in_blanks := o ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ENDIF ; ENDIF ; ELSEIF (= symTrans_lineType '/*') THEN null ; % comments are not output, and don''t affect flags ; ELSEIF (AND (NOT in_blanks) (in chrList@i chrs_blank) (= 0 flags@2)) THEN in_blanks := l ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ELSEIF (in chrList@i chrs_symbols_HFLN) THEN flags@1 := 1 ; execute symExtract_decisionTable@(flags) ; ELSEIF (in chrList@i chrs_paren_strt) THEN flags@1 := 0 ; IF (= 1 flags@0) THEN n_paren := n_paren + 1 ; flags@2 := 1 ; ENDIF ; in_blanks := o ; execute symExtract_decisionTable@(flags) ; ELSEIF (in chrList@i chrs_paren_stop) THEN flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; IF (= 1 flags@0) THEN n_paren := n_paren - 1 ; IF (0 < n_paren) THEN flags@2 := 1 ; ELSE flags@2 := 0 ; ENDIF ; ENDIF ; in_blanks := o ; % for non-[chrs_blank,chrs_symbols_HFLN,chrs_[strt,stop]_paren] characters ; ELSE in_blanks := o ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ENDIF ; i := i + 1 ; ENDWHILE ; % ; %capture the symNew at the end of the line (if there is one) ; %THIS HAS CHANGED! a triplet of lists is returned by symExtract_stringPosn! IF (= 1 flags@0) THEN symList := link symList (solitary symNew) ; posnList := link symList (solitary i) ; % placeholder as this is WRONG! ; typeList := link symList (solitary symTrans_lineType) ; ENDIF ; symParenList := syms_inParens symList ; symExStr_List symExPosn_List symExType_List := EACH symExtract_stringPosn symParenList ; symList posnList typeList := EACHBOTH link (symList posnList typeList) (symExStr_List symExPosn_List symExType_List) ; % ; %------------ ; %stops recursive calls ; ELSE symList := null ; %write link 'symExtractstring recurLevel null string input: ' (string symExtractString_recurLevel) ; ENDIF ; % ; symList typeList posnList } +-----+ # IF (= chrList@i '/') THEN IF ((i + 1) < len) THEN IF (= chrList@(i + 1) '*') THEN symTrans_lineType := '/*' ; flags@3 := 1 ; i := i + 1 ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ELSEIF (= chrList@(i + 1) '$') THEN symTrans_lineType := '/$' ; i := i + 1 ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ELSEIF (= chrList@(i + 1) '%') THEN symTrans_lineType := '/%' ; i := i + 1 ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ELSE % treated same as ELSE in first IF ; in_blanks := o ; flags@1 := 0 ; execute symExtract_decisionTable@(flags) ; ENDIF ; ENDIF ; Change : +-----+ symExtract_decisionTable := 2 2 2 reshape '(0 0 0) ; null ; ' '(0 0 1) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(0 1 0) ; symNew := link symNew chrList@i ; posnList := link posnList i ; flags@0 := 1 ; ' '(0 1 1) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(1 0 0) ; symList := link symList (solitary symNew) ; symNew := null ; flags@0 := 0 ; ' '(1 0 1) ; symNew := link symNew chrList@i ; ' '(1 1 0) ; symNew := link symNew chrList@i ; ' '(1 1 1) ; symNew := link symNew chrList@i ; ' ; +-----+ To : +-----+ symExtract_decisionTable := 2 2 2 reshape '(0 0 0) ; null ; ' '(0 0 1) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(0 1 0) ; symNew := link symNew chrList@i ; posnList := link posnList i ; typeList := link typeList (solitary symTrans_lineType) ; flags@0 := 1 ; ' '(0 1 1) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(1 0 0) ; symList := link symList (solitary symNew) ; symNew := null ; flags@0 := 0 ; ' '(1 0 1) ; symNew := link symNew chrList@i ; ' '(1 1 0) ; symNew := link symNew chrList@i ; ' '(1 1 1) ; symNew := link symNew chrList@i ; ' ; +-----+ # wasted change # flags = (in_sym in_[chrs_symbols_HFLN,valid_unicode] in_paren in_comment) symExtract_decisionTable := 2 2 2 2 reshape '(0 0 0 0) ; null ; ' '(0 0 0 1) ; null ; ' '(0 0 1 0) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(0 0 1 1) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(0 1 0 0) ; symNew := link symNew chrList@i ; posnList := link posnList i ; flags@0 := 1 ; ' '(0 1 0 1) ; null ; ' '(0 1 1 0) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(0 1 1 1) ; write_testStr ''symExtract_string ; error with flags@2'' ; ' '(1 0 0 0) ; symList := link symList (solitary symNew) ; symNew := null ; flags@0 := 0 ; ' '(1 0 0 1) ; null ; ' '(1 0 1 0) ; symNew := link symNew chrList@i ; ' '(1 0 1 1) ; null ; ' '(1 1 0 0) ; symNew := link symNew chrList@i ; ' '(1 1 0 1) ; null ; ' '(1 1 1 0) ; symNew := link symNew chrList@i ; ' '(1 1 1 1) ; null ; ' ; I changed symExtract_string but forgot to document it. Changed to : +-----+ symExtract_string IS OP str_stdForm { symExtractString_recurLevel := -1 ; 2 take symExtract_stringPosn str_stdForm } +-----+ Change : +-----+ symExtract_file IS OP pname_inn d_out { LOCAL dinn finn_base finn_extension fin fot_Lucas fot_HFLN str str_old symList symList_line symTrans_lineType ; % ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_inn ; pname_temp1 := link d_out finn_base ' temp1.' finn_extension ; pname_temp2 := link d_out finn_base ' temp2.' finn_extension ; pname_Lucas := link d_out finn_base ' Lucas.' finn_extension ; pname_HFLN := link d_out finn_base ' HFLN.' finn_extension ; % ; IF (file_exists '-f' pname_inn) THEN % ; finn := open pname_inn "r ; fot_Lucas := open pname_Lucas "w ; fot_HFLN := open pname_HFLN "w ; str_old := null ; WHILE (~= ??eof (str := readfile finn)) DO IF (OR ('=<>#$%' EACHLEFT in str)) THEN IF (in str@0 '#$%') THEN symTrans_lineType := str@0 ; ENDIF ; IF (= `# symTrans_lineType) THEN null ; ELSE symList_line := symExtract_string str_old ; symList := EACH sym_stdForm symList_line ; IF (~= null symList_line) THEN %write symList ; IF (= `$ symTrans_lineType) THEN fot_Lucas EACHRIGHT writefile symList ; ELSEIF (= `% symTrans_lineType) THEN fot_HFLN EACHRIGHT writefile symList ; ENDIF ; ENDIF ; str_old := str ; ENDIF ; ELSE str_old := link str_old str ; ENDIF ; ENDWHILE ; EACH close finn fot_Lucas fot_HFLN ; % ; host link 'cat "' pname_Lucas '" | grep --invert-match "^[0-9]*$" >"' pname_temp1 '" ' ; host link 'sort --unique "' pname_temp1 '" >"' pname_temp2 '" ' ; host link 'mv "' pname_temp2 '" "' pname_Lucas '" ' ; host link 'rm "' pname_temp1 '" ' ; % ; host link 'cat "' pname_HFLN '" | grep --invert-match "^[0-9]*$" >"' pname_temp1 '" ' ; host link 'sort --unique "' pname_temp1 '" >"' pname_temp2 '" ' ; host link 'mv "' pname_temp2 '" "' pname_HFLN '" ' ; host link 'rm "' pname_temp1 '" ' ; % ; symbols_compare pname_Lucas pname_HFLN ; host link 'bash "' d_QNial_mine 'symbols count in file.sh"' ; % ; write 'symExtract_file - processing executed normally on file :' ; write link ' "' pname_inn '" ' ; l ELSE write 'symExtract_file ERROR- file does not exist :' write ' "' pname_inn '" ' ; o ENDIF } +-----+ To : +-----+ # 03Sep2018 NOTE : symExtract_file MUST be fed a file pname_stdForm_inn to get proper symbols! symExtract_file IS OP pname_stdForm_inn d_out { LOCAL dinn finn_base finn_extension fin fot_Lucas fot_HFLN str str_old symList symList_line ; % ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_stdForm_inn ; pname_temp1 := link d_out finn_base ' temp1.' finn_extension ; pname_temp2 := link d_out finn_base ' temp2.' finn_extension ; pname_Lucas := link d_out finn_base ' Lucas.' finn_extension ; pname_HFLN := link d_out finn_base ' HFLN.' finn_extension ; % ; IF (file_exists '-f' pname_stdForm_inn) THEN % ; finn := open pname_stdForm_inn "r ; fot_Lucas := open pname_Lucas "w ; fot_HFLN := open pname_HFLN "w ; WHILE (~= ??eof (str := readfile finn)) DO symList type_symList := symExtract_string str ; symSelect_HFLN := '/%' EACRIGHT = type_symList ; symList_HFLN symList_Lucas := (symSelect_HFLN (EACH NOT symSelect_HFLN)) EACHLEFT sublist symList ; fot_HFLN fot_Lucas EACHBOTH writefile symList_HFLN symList_Lucas ; ENDWHILE ; EACH close finn fot_Lucas fot_HFLN ; % ; host link 'cat "' pname_Lucas '" | grep --invert-match "^[0-9]*$" >"' pname_temp1 '" ' ; host link 'sort --unique "' pname_temp1 '" >"' pname_temp2 '" ' ; host link 'mv "' pname_temp2 '" "' pname_Lucas '" ' ; host link 'rm "' pname_temp1 '" ' ; % ; host link 'cat "' pname_HFLN '" | grep --invert-match "^[0-9]*$" >"' pname_temp1 '" ' ; host link 'sort --unique "' pname_temp1 '" >"' pname_temp2 '" ' ; host link 'mv "' pname_temp2 '" "' pname_HFLN '" ' ; host link 'rm "' pname_temp1 '" ' ; % ; symbols_compare pname_Lucas pname_HFLN ; host link 'bash "' d_QNial_mine 'symbols count in file.sh"' ; % ; write 'symExtract_file - processing executed normally on file :' ; write link ' "' pname_stdForm_inn '" ' ; l % ; ELSE write link 'symExtract_file ERROR- file does not exist : "' pname_stdForm_inn '" ' ; ENDIF ; } # Test of writefile null : qnial> fot := open '/media/bill/ramdisk/writefile_null test.txt' "w 3 qnial> writefile fot null qnial> close fot >> an empty line is written to the file - this is OK, saves two conditionals +-----+ Change : +-----+ symTrans IS OP symbol { LOCAL symNew ; NONLOCAL symTrans_lineType trans_old_Lucas trans_new_Lucas trans_old_HFLN trans_new_HFLN ; % ; % find_Howell-choose returns a SINGLE (not a solitary!) ; IF (= `$ symTrans_lineType) THEN symNew := (find_Howell symbol trans_old_Lucas) choose trans_new_Lucas ; %write_debug trans_new@(find_Howell symbol trans_old_Lucas) ; ELSEIF (= `% symTrans_lineType) THEN symNew := (find_Howell symbol trans_old_HFLN ) choose trans_new_HFLN ; %write_debug trans_new@(find_Howell symbol trans_old_HFLN ) ; ELSE symNew := fault '?symTrans ERROR: unknown symTrans_lineType' ; ENDIF ; IF (isfault symNew) THEN symNew := symbol ; ELSEIF (= null (gage shape symNew)) THEN symNew := first symNew ; ENDIF ; symNew } +-----+ To : +-----+ # 03Sep2018 NOTE : symTrans MUST be fed a symbol symbol_stdForm in standard format to get proper symbols! symTrans IS OP symbol_stdForm symType { LOCAL symNew ; NONLOCAL symTrans_lineType trans_old_Lucas trans_new_Lucas trans_old_HFLN trans_new_HFLN ; % ; % find_Howell-choose returns a SINGLE (not a solitary!) ; IF (= symType symTrans_lineType) THEN symNew := (find_Howell symbol_stdForm trans_old_Lucas) choose trans_new_Lucas ; %write_debug trans_new@(find_Howell symbol_stdForm trans_old_Lucas) ; ELSEIF (= symType symTrans_lineType) THEN symNew := (find_Howell symbol_stdForm trans_old_HFLN ) choose trans_new_HFLN ; %write_debug trans_new@(find_Howell symbol_stdForm trans_old_HFLN ) ; ELSE symNew := fault '?symTrans ERROR: unknown symTrans_lineType' ; ENDIF ; IF (isfault symNew) THEN symNew := symbol_stdForm ; ELSEIF (= null (gage shape symNew)) THEN symNew := first symNew ; ENDIF ; symNew } +-----+ Change : +-----+ #******************************* # symsExtractTranslate IS OP sym - prepares a string and a sed expression # for translate_sed using a dictionary, so all dictionary subs are done # 09Apr2018 in the future I need to specify translation "dictionaries"! (not just use default names!) # 02May2018 keep [spaces,tabs] outside of symbols, standard form within # 02May2018 for now find_HOWELL searches entire trans_old, but I should use an efficient search! # if str starts with `$, then it is NOT translated, and the original string is returned # don't spend time on [expr,sym] locations initially, as the str is continually changing! # 05May2018 symList_raw components may change to a standard format, but for now expressions don't have a standard form ; # 05May2018 lines with no [syms,xprs] - errors and waste of time # QNial version # Note : # symbols - are symbol_character sequences, or compound phrases in a "headed parenthetical wrapping" # some such symbols are in trans_table, and thereby have a translation # expressions - are collections of symbols that have translations in transExpr_table symsExtractTranslate IS OP str { LOCAL address i lengths mixList mixList_cull textnew xprList_raw xprList_trn symList_raw symList_std symList_trn symList_raw_chg symList_std_chg symList_trn_chg allList_raw allList_std allList_trn allList_raw_grade allList_trn_grade allList_raw_cull allList_trn_cull ; NONLOCAL chrs_symbols_HFLN ; % ; textnew := str ; xprList_raw xprList_trn := xprs_ExtractTranslate str ; symList_raw := symExtract_string str ; % ; symList_std := EACH sym_stdForm symList_raw ; symList_trn := EACH symTrans symList_std ; % ; %pick out only the symbols that change from raw to trn!! ; symList_raw_chg symList_std_chg symList_trn_chg := (EACHBOTH ~= symList_raw symList_trn ) EACHRIGHT sublist (symList_raw symList_std symList_trn ) ; % ; % combine syms and xprs into "allLists" ; allList_raw := link symList_raw_chg xprList_raw ; allList_std := link symList_std_chg xprList_raw ; allList_trn := link symList_trn_chg xprList_trn ; % ; %sort the two lists [raw,trn]. This is to force replacement of the largest [syms,exprs] first, so the simple "atomic" syms don't prevent larger coherent translations ; % sort by decreasing length of allList_std - BOTH [allList_raw,allList_trn] must be the same shape to cull a pair. ; lengths := EACH (gage shape) allList_std ; address := grade >= lengths ; %write '[lengths,address]= ' lengths address ; allList_raw_grade allList_trn_grade := address EACHRIGHT choose allList_raw allList_trn ; %EACH write '[allList_raw_grade,allList_trn_grade]= ' allList_raw_grade allList_trn_grade ; % ; %cull the two lists [raw,trn] ; mixList := allList_raw_grade EACHBOTH pair allList_trn_grade ; mixList_cull := cull mixList ; allList_raw_cull allList_trn_cull := [EACH first, EACH second] mixList ; % ; %EACH write '[str, allList_raw, allList_std, allList_trn, allList_raw_cull allList_trn_cull]= ' str allList_raw allList_std allList_trn allList_raw_cull allList_trn_cull ; % ; %replace allList_raw_cull with allList_trn_cull one at at a time, as textnew changes with each substitution ; %multiple instances of a allList_raw_cull are replaced. ; %write link 'raw str= ' str ; FOR i WITH tell gage shape allList_raw_cull DO textnew := symExpr_sub allList_raw_cull@i allList_trn_cull@i textnew ; %write allList_raw_cull@i allList_trn_cull@i ; %write link (string i) ' : ' textnew ; ENDFOR ; % ; textnew } +---+ symTranslate_string IS OP str { LOCAL flag_symFirst strNew ; NONLOCAL symTrans_lineType ; % ; flag_symFirst := o ; IF (in str@0 '#$%') THEN symTrans_lineType := str@0 ; flag_symFirst := l ; ENDIF ; IF (= `# symTrans_lineType) THEN strNew := str ; ELSE strNew := symsExtractTranslate str ; ENDIF ; strNew } +-----+ To : (symsExtractTranslate is integrated into symTranslate_string) +-----+ # 03Sep2018 NOTE : # For debug : symTranslate_string MUST be fed a string str_stdForm in standard format to get proper symbols! # To translate original file, retaining spaces - feed a "natural string" symTranslate_string IS OP flag_stdForm str { LOCAL address i lengths mixList mixList_cull textnew xprList_org symList_org symList_org_chg allList_org allList_org_grade allList_org_cull xprList_trn symList_trn symList_trn_chg allList_trn allList_trn_grade allList_trn_cull ; NONLOCAL chrs_symbols_HFLN ; % ; textnew := str ; xprList_org xprList_trn := xprs_ExtractTranslate str ; % ; IF flag_stdForm THEN symList_org typeList posnList := symExtract_string str ; ELSE symList_org typeList posnList := symExtract_string sym_stdForm str ; ENDIF ; symList_trn := EACH symTrans (EACHBOTH pair symList typeList) ; % ; %pick out only the symbols that change from raw to trn!! ; symList_org_chg symList_trn_chg := (EACHBOTH ~= symList_org symList_trn ) EACHRIGHT sublist (symList_org symList_trn ) ; % ; % combine syms and xprs into "allLists" ; allList_org := link symList_org_chg xprList_org ; allList_trn := link symList_trn_chg xprList_trn ; % ; %sort the two lists [raw,trn]. This is to force replacement of the largest [syms,exprs] first, so the simple "atomic" syms don't prevent larger coherent translations ; % sort by decreasing length of allList_org - BOTH [allList_org,allList_trn] must be the same shape to cull a pair. ; lengths := EACH (gage shape) allList_org ; address := grade >= lengths ; %write '[lengths,address]= ' lengths address ; allList_org_grade allList_trn_grade := address EACHRIGHT choose allList_org allList_trn ; %EACH write '[allList_org_grade,allList_trn_grade]= ' allList_org_grade allList_trn_grade ; % ; %cull the two lists [raw,trn] ; mixList := allList_org_grade EACHBOTH pair allList_trn_grade ; mixList_cull := cull mixList ; allList_org_cull allList_trn_cull := [EACH first, EACH second] mixList ; % ; %EACH write '[str_stdForm allList_org allList_org allList_trn allList_org_cull allList_trn_cull]= ' str_stdForm allList_org allList_org allList_trn allList_org_cull allList_trn_cull ; % ; %replace allList_org_cull with allList_trn_cull one at at a time, as textnew changes with each substitution ; %multiple instances of a allList_org_cull are replaced. ; %write link 'raw str_stdForm= ' str_stdForm ; FOR i WITH tell gage shape allList_org_cull DO textnew := symExpr_sub allList_org_cull@i allList_trn_cull@i textnew ; %write allList_org_cull@i allList_trn_cull@i ; %write link (string i) ' : ' textnew ; ENDFOR ; % ; textnew } +-----+ Change : +-----+ symTranslate_file IS OP flag_debug pname_inn d_out { LOCAL d_out fin fot i fname_base fname_extension line_in p_log_test pname_out str ; NONLOCAL d_Lucas d_QNial_mine d_QNial_temp p_log_test_fNum ; % ; p_log_test := link d_QNial_mine 'symbols log.txt' ; IF (p_log_test = 'stdout') THEN p_log_test_fNum := 1 ; ELSE p_log_test_fNum := open p_log_test "a ; ENDIF ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_inn ; pname_out := link d_out finn_base ' trans.' finn_extension ; % ; EACH write_testStr ' ' '+---------------+' (link 'symTranslate_file, ' timestamp_YYMMDD_HMS) ; write_testStr 'uses symTranslate_string, which translates symbols and expressions' ; write_testStr link 'pname_inn= ' pname_inn ; write_testStr link 'pname_out= ' pname_out ; % ; i := 0 ; fin := open pname_inn "r ; fot := open pname_out "w ; WHILE ( ~= ??eof (str := readfile fin)) DO line_in := symTranslate_string str ; writefile fot line_in ; i := i + 1 ; ENDWHILE ; EACH close fin fot ; % ; symExtract_file pname_out d_out ; % ; write_testStr timestamp ; IF (p_log_test_fNum ~= 1) THEN close p_log_test_fNum ; ENDIF ; p_log_test_fNum := 1 ; } +-----+ To : +-----+ # symTranslate_file IS OP flag_debug f_derivations - [extraction,translation] of [syms,exprs] in Lucas f_derivation file # www.BillHowell.ca 14Apr2018 initial, 06Jul2018 moved to "symbols translate.ndf" # 03Sep2018 sym[Extract,Translate]_file format : # debug mode - MUST use file pname_inn that has already been processed by sym_stdForm_file!! # normal mode - uses original format of file # flag_debug indicates where (or not) pname_inn is in standard format symTranslate_file IS OP flag_debug pname_stdForm_inn d_out { LOCAL d_out fin fot i fname_base fname_extension line_in p_log_test pname_out str ; NONLOCAL d_Lucas d_QNial_mine d_QNial_temp p_log_test_fNum ; % ; p_log_test := link d_QNial_mine 'symbols log.txt' ; IF (p_log_test = 'stdout') THEN p_log_test_fNum := 1 ; ELSE p_log_test_fNum := open p_log_test "a ; ENDIF ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_stdForm_inn ; pname_out := link d_out finn_base ' trans.' finn_extension ; % ; EACH write_testStr ' ' '+---------------+' (link 'symTranslate_file, ' timestamp_YYMMDD_HMS) ; write_testStr 'uses symTranslate_string, which translates symbols and expressions' ; write_testStr link 'pname_stdForm_inn= ' pname_stdForm_inn ; write_testStr link 'pname_out= ' pname_out ; % ; i := 0 ; fin := open pname_stdForm_inn "r ; fot := open pname_out "w ; WHILE ( ~= ??eof (str := readfile fin)) DO line_in := symTranslate_string flag_debug str ; writefile fot line_in ; i := i + 1 ; ENDWHILE ; EACH close fin fot ; % ; symExtract_file pname_out d_out ; % ; write_testStr timestamp ; IF (p_log_test_fNum ~= 1) THEN close p_log_test_fNum ; ENDIF ; p_log_test_fNum := 1 ; } +-----+ ************************ 02Sep2018 Run symDebug_file IS OP pname_inn d_out after many improvements, adaptations of the code for code debugging - a simpler, clear process was put in place, base on the [symbol, expression] coding extant details - see : +-----+ "/media/bill/PROJECTS/Qnial/MY_NDFS/symbols instructions.txt" >>> CODE MODIFICATIONS >>>>>> 2. Run symDebug_file to generate output of [sym_stdForm, symExtract, symTranslate] to help fix code qnial> symDebug_file f_derivations d_QNial_temp +-----+ >> sym_stdForm worked well >> symTranslate_file - not sure if it worked (would have to check very closely) but at least it ran >> failed : "Howell - Background math for Lucas Universal Force, Chapter 4 stdForm trans [HFLN, Lucas].txt" "symbols&count [HFLN, Lucas].txt" "symDiff bads [HFLN, Lucas].txt" "symList temp[1,2].txt" # First problem - symTranslate_file should NOT add line numbers, as that is already done by sym_stdForm +-----+ symTranslate_file IS OP flag_debug pname_inn d_out { LOCAL d_out fin fot i fname_base fname_extension line_in p_log_test pname_out str ; NONLOCAL d_Lucas d_QNial_mine d_QNial_temp p_log_test_fNum ; % ; p_log_test := link d_QNial_mine 'symbols log.txt' ; IF (p_log_test = 'stdout') THEN p_log_test_fNum := 1 ; ELSE p_log_test_fNum := open p_log_test "a ; ENDIF ; dinn finn_base finn_extension := filepath_pathBaseExtn pname_inn ; pname_out := link d_out finn_base ' trans.' finn_extension ; % ; EACH write_testStr ' ' '+---------------+' (link 'symTranslate_file, ' timestamp_YYMMDD_HMS) ; write_testStr 'uses symTranslate_string, which translates symbols and expressions' ; write_testStr link 'pname_inn= ' pname_inn ; write_testStr link 'pname_out= ' pname_out ; % ; i := 0 ; fin := open pname_inn "r ; fot := open pname_out "w ; WHILE ( ~= ??eof (str := readfile fin)) DO line_in := symTranslate_string str ; IF flag_debug THEN writefile fot (link (string i) ' ' line_in) ; ELSE writefile fot line_in ; ENDIF ; i := i + 1 ; ENDWHILE ; EACH close fin fot ; % ; symExtract_file pname_out d_out ; % ; write_testStr timestamp ; IF (p_log_test_fNum ~= 1) THEN close p_log_test_fNum ; ENDIF ; p_log_test_fNum := 1 ; } +-----+ Change : +-----+ IF flag_debug THEN writefile fot (link (string i) ' ' line_in) ; ELSE writefile fot line_in ; ENDIF ; +-----+ To: +-----+ writefile fot line_in ; +-----+ Re-run : qnial> symDebug_file f_derivations d_QNial_temp >> OK, now it runs and the problems are back Maybe I must retain one space at the "top level", but not within parenthesis? to keep symbols from running together (don't worry about expressions for now), insist on commas eg (5 6 7 8) -> (5,6,7,8) ***************************** 03Sep2018 symTrans_lineType - change symbols, convert to within-str changes, and improve symbols systems Changing from line to in-line resetting of symTrans_lineType see "media/bill/PROJECTS/Qnial/code develop_test/symbols zpecial - symTrans_lineType redefinition.txt" 04Sep2018 will this cause problems? : symExtract_string IS OP str_stdForm { symExtractString_recurLevel := -1 ; 2 take symExtract_stringPosn str_stdForm } To prepare for testing, it's easiest to convert the f_derivations files to the new approach to symTrans_lineType. $ d_Lucas="/media/bill/PROJECTS/Lucas - Universal Force/" $ d_temp="/media/bill/ramdisk/" $ cat "$d_Lucas""Howell - Background math for Lucas Universal Force, Chapter 4.txt" | sed 's/^#/\/\*/;s/^\%/\/\%/;s/^\$/\/\$/' >"$d_temp""Howell - Background math for Lucas Universal Force, Chapter 4.txt" $ cat "$d_Lucas""Howell - math of Lucas Universal Force.txt" | sed 's/^#/\/\*/;s/^\%/\/\%/;s/^\$/\/\$/' >"$d_temp""Howell - math of Lucas Universal Force.txt" >> done, seems OK +-----+ FOR LATER Testing of files : qnial> d_testFile1 := '/media/bill/PROJECTS/Qnial/code develop_test/testFile 1/' ; qnial> d_testFile2 := '/media/bill/PROJECTS/Qnial/code develop_test/testFile 2/' ; Testing commands - input NOT in standard format : qnial> symTranslate_file o (link d_testFile1 "text_original1.txt") (link d_temp "text_trans1.txt") qnial> symTranslate_file o (link d_testFile2 "text_original2.txt") (link d_temp "text_trans2.txt") Testing commands - input IS IN in standard format : qnial> symTranslate_file o (link d_testFile1 "text_original1.txt") (link d_temp "text_trans1.txt") qnial> symTranslate_file o (link d_testFile1 "text_original2.txt") (link d_temp "text_trans2.txt") After studies and adjustments, copy correct results back to d_testFile[1, 2] a set of "correct file results" can be saved diff can show if current code works properly +-----+ ***************************** 04Sep2018 13:10 Proceed with standard tests of [strings, sym[Extract, Translate]]. qnial> lq_symTests >> all load correctly (albeit many need fixing!) Modifications are needed to many because of changes. However, first try qnial> strings_alltest >> "alltest strings 180904 13h31m19s.txt" - only one failure : +-----+ # sym_stdForm_test example 28 : FAILED - result does NOT match standard # sym_stdForm_test example 28 : FAILED - result does NOT match standard t_input, t_standard, t_result = *(vrp)/ *(vrp)/ *(vrp) +-----+ >> This was NOT a failure in previous tests!! >> It is a VERY interesting example, as the string terminates by the important character `/ : +-----+ IF (= chrList@i '/') THEN IF ((i + 1) < len) THEN IF (= chrList@(i + 1) '*') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/*' ; strStdForm := link strStdForm '/*' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '$') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/$' ; strStdForm := link strStdForm '/$' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '%') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/%' ; strStdForm := link strStdForm '/%' ; ELSEIF (= chrList@(i + 1) '^') THEN symTrans_lineType := symTrans_lineType_old ; strStdForm := link strStdForm '/%' ; symTrans_lineType_old := symTrans_lineType ; i := i + 1 ; ELSE strStdForm := link strStdForm '/' ; ENDIF ; ENDIF ; +-----+ >> This is missing an ELSE!! Change to : +-----+ IF (= chrList@i '/') THEN IF ((i + 1) < len) THEN IF (= chrList@(i + 1) '*') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/*' ; strStdForm := link strStdForm '/*' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '$') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/$' ; strStdForm := link strStdForm '/$' ; i := i + 1 ; ELSEIF (= chrList@(i + 1) '%') THEN symTrans_lineType_old := symTrans_lineType ; symTrans_lineType := '/%' ; strStdForm := link strStdForm '/%' ; ELSEIF (= chrList@(i + 1) '^') THEN symTrans_lineType := symTrans_lineType_old ; strStdForm := link strStdForm '/%' ; symTrans_lineType_old := symTrans_lineType ; i := i + 1 ; ELSE strStdForm := link strStdForm '/' ; ENDIF ; ELSE strStdForm := link strStdForm '/' ; ENDIF ; +-----+ Re-try : qnial> loaddefs link d_QNial_mine 'symbols system loaddefs.ndf' >>>>>> loading start : symbols system loaddefs.ndf <<<<<< loading ended : symbols system loaddefs.ndf qnial> strings_alltest >> OK - all examples including #28, work ***************************** 04Sep2018 13:10 Standard tests of "symbols extract- tests.ndf" # symExtract_stringPosn IS OP str_stdForm - extracts symbol [characters, type, position]s from a string in standard format >> changes to tests - this now requires standard format input - output now includes 3, not 2 sets [symList typeList posnList] - will "mix take care of it or screw it up? Change : +-----+ t_result := mix symExtract_stringPosn t_input ; +-----+ To : +-----+ t_result := mix (symExtract_stringPosn sym_stdForm t_input) ; +-----+ # symExtract_file IS OP pname_inn pname_Lucas pname_HFLN - to extract a list of [all, known, unkown] symbols # from a text file, with reference to a dictionary, ignoring comments and descriptions # 03Sep2018 NOTE : symExtract_file MUST be fed a file pname_stdForm_inn to get proper symbols! >> hasn't been created yet qnial> loaddefs link d_Qnial_mine 'symbols extract.ndf' >>>>>> loading start : symbols extract.ndf <<<<<< loading ended : symbols extract.ndf qnial> symExtract_alltest >> failed tests : symExtract_stringPosn_test, 180904 14h19m08s symExtract_string_test, 180904 14h19m08s mix yields a TABLE, not lists but symExtract_stringPosn_test returns a line list of 3 ?no_values and symExtract_string_test returns a list of 2 solitary ?no_value I need to trace the operators and see where the problem arises. ***************************** 05Sep2018 13:10 Standard tests of "symbols translate- tests.ndf" problem with posnList : see "/media/bill/PROJECTS/Qnial/code development/symbols extract- develop.txt" *********************************************** *********************************************** 12Sep2018 08:31 MAJOR CHANGE!!! - Write a separate systme to "align-format" derivations!!! Abandon tracking of [symbol, expression] positions - translations work in str_stdForm I still need typeList Huge difference : - enormously simplify sym[Extract, Translate] - highly useful for non-aligned derivations and adhoc work day-by-day Just do a file-based approach Hopefully independent of symbol system -> don't have to "recognized" [symbols, expressions] +-----+ symExtract_stringRecur : After a few thinking challenges : qnial> symExtract_stringRecur_test #+-----+ symExtract_stringRecur_test, 180912 12h22m25s # symExtract_stringRecur_test example 3a : OK - result matches standard t_input, t_standard, t_result = (a·∇) = (a1*n1 + a2*n2 + a3*n3)/∂x1*n1 · (∂/∂x1*n1 + ∂/∂x2*n2 + ∂/∂x3*n3) +-----+ +-----+ symTrans_lineType = "/$" so there is No symNew. Note the resulting t_standard!! +-----+ >> OK! This works ... After a few simple fixes : qnial> symExtract_string_test #+-----+ symExtract_string_test, 180912 14h05m40s >> ALL are OK!! +-----+ Summary of test results : /media/bill/PROJECTS/Qnial/code develop_test/alltest symExtract 180912 14h15m12s.txt, date= 180912 14h15m # symParen_contents_test example 1 : OK - result matches standard # symParen_contents_test example 2 : OK - result matches standard # symParen_contents_test example 3 : OK - result matches standard # symParen_contents_test example 4 : OK - result matches standard # symParen_contents_test example 5 : OK - result matches standard # syms_inParens_test example 1 : OK - result matches standard # syms_inParens_test example 2 : OK - result matches standard # syms_inParens_test example 3 : OK - result matches standard # syms_inParens_test example 4 : OK - result matches standard # syms_inParens_test example 5 : OK - result matches standard # symExtract_stringRecur_test example 1 : OK - result matches standard # symExtract_stringRecur_test example 2 : OK - result matches standard # symExtract_stringRecur_test example 3 : OK - result matches standard # symExtract_stringRecur_test example 3a : OK - result matches standard # symExtract_stringRecur_test example 4 : OK - result matches standard # symExtract_stringRecur_test example 5 : OK - result matches standard # symExtract_stringRecur_test example 6 : OK - result matches standard # symExtract_stringRecur_test example 7 : OK - result matches standard # symExtract_stringRecur_test example 8 : OK - result matches standard # symExtract_stringRecur_test example 9 : OK - result matches standard # symExtract_stringRecur_test example 10 : OK - result matches standard # symExtract_stringRecur_test example 11 : OK - result matches standard # symExtract_string_test example 1 : OK - result matches standard # symExtract_string_test example 2 : OK - result matches standard # symExtract_string_test example 3 : OK - result matches standard # symExtract_string_test example 4 : OK - result matches standard # symExtract_string_test example 5 : OK - result matches standard # symExtract_string_test example 6 : OK - result matches standard # symExtract_string_test example 7 : OK - result matches standard # symExtract_string_test example 8 : OK - result matches standard # symExtract_string_test example 9 : OK - result matches standard # symExtract_string_test example 10 : OK - result matches standard # symExtract_string_test example 11 : OK - result matches standard # symExtract_string_test example 21 : OK - result matches standard # symExtract_string_test example 22 : OK - result matches standard # symExtract_string_test example 23 : OK - result matches standard # enddoc