**Human Language Root Words & Lexicostatistics Calculator and eTCL Slot Calculator Demo Example** This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER in your comment with the same courtesy that I will give you. Its very hard to reply intelligibly without some background of the correspondent. Thanks,[gold] ---- <> ** Introduction** [gold] Here is some eTCL starter code on a calculator for human language root words. The impetus for these calculations was checking some references in Sumerian and cuneiform mathematics. Most of the testcases involve experiments or models, using assumptions and rules of thumb. The original formulas were developed by Morris Swadesh in the changes of native American languages, published 1950 to 1955. Swadesh published a lexical constant fraction of 0.86 in 1955, restating that 86% of original root words should remain in a source language after 1000 years. In the various papers, Swadesh used selected word lists of 215, 200, and 100 root words. The original formula was N(t) = N(0)*exp(-lambda*t). In eTCL notation, the remaining root words N2= [*kay [/ N1 [exp [/ $t 1000.]]]], where N1 is the original set of root words, 1000. years for millennium, and t is the time in years. The constant kay equals [* [/ 86. 200.] [exp 1. ]] or 1.16886, where [exp 1. ]] is familiar natural number 2.718. As a rule of thumb, a second language with different roots of 50 percent is not easily understandable from a first or source language, and probably would be considered a second language. There might be 5 percent error in comparison lists of two languages, so the 50% criterion from the rule of thumb can be relaxed somewhat. In modeling a descendent language from a source language, the criterion is postulated that a language with 46 percent of root words remaining is a descendent of the source language. Another basic formula is time equals (ln c) / (ln r), where t is time in years, c is percentage of remaining roots, and r is the roots constant (typically 86). The gist is that human languages change over the years and if there are N1 number of roots in the source language, there will be some smaller fraction N2 left over the years. *** Pseudocode Section*** ====== pseudocode can be developed from rules of thumb. pseudocode: enter time in years, number of remaining root words pseudocode: output fraction of (remaining root words) over (root words at time zero) pseudocode: ouput remaining root words as fraction pseudocode: rules of thumb can be 3 to 15 percent off, partly since g..in g..out. pseudocode: need test cases > small,medium, giant pseudocode: need testcases within range of expected operation. pseudocode: are there any cases too small or large to be solved? ====== ---- ***Testcases Section*** In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines). **** Testcase 1 **** %| ancient language|table printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number| 1||& &| time in years at time zero :| 1000. ||& &| root words at time zero:| 200. ||& &| root words after time (t2-t0) :| 86. ||& &| answers: min. remaining root words fm formula :|85.0 ||& &| ratio remaining root words :| 0.43 ||& &| remaining root words percentage:| 43.0 ||& &|language descendent criterion > 46% (0 or 1) :| 0. ||& ---- **** Testcase 2 **** %| ancient language 2 |printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number| 2||& &| time in years at time zero :| 1000. ||& &| root words at time zero:| 200. ||& &| root words after time (t2-t0) :| 120. ||& &| answers: min. remaining root words fm formula :|85.0 ||& &| ratio remaining root words :| 0.6 ||& &| remaining root words percentage:| 60.0 ||& &|language descendent criterion > 46% (0 or 1) :| 1. ||& ---- **** Testcase 3 **** %| ancient language 3 |table printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number| 3||& &| time in years at time zero :| 1000. ||& &| root words at time zero:| 200. ||& &| root words after time (t2-t0) :| 160. ||& &| answers: min. remaining root words fm formula :|85.0 ||& &| ratio remaining root words :| 0.8 ||& &| remaining root words percentage:| 80.0 ||& &| language descendent criterion > 46% (0 or 1) :| 1. ||& ---- **** Testcase 3 **** %| ancient language and lower bound calculation |printed in| tcl wiki format|% &| quantity| value| comment, if any|& &| testcase number| 4||& &| time in years at time zero :| 1000. ||& &| root words at time zero:| 200. ||& &| root words after time (t2-t0) :| 120. ||& &| answers: min. remaining root words fm formula :|85.0 ||& &| ratio remaining root words :| 0.6 ||& &| remaining root words percentage:| 60.0 ||& &| minimal roots 85 reloaded to establish lower bound| ****** |******|& &| time in years at time zero :| 1000. ||& &| root words at time zero:| 200. ||& &| root words after time (t2-t0) :| 85. ||& &| answers: min. remaining root words fm formula :|85.0 ||& &| ratio remaining root words :| 0.425 ||& &| remaining root words percentage:| 42.5 ||& &| language descendent criterion > 46% (0 or 1) :| 0. ||& &| percentge lower to upper bounds :|42% to 60% ||& ---- ***Screenshots Section*** ****figure 1.**** [http://s26.postimg.org/thfta20m1/human_language_root_wrods_TCL_WIKI.gif] ---- ***References:*** * Lexicostatistics, google search * ABC's of Lexicostatistics, Sarah C. Gudschinsky ---- **Appendix Code** ***appendix TCL programs and scripts *** ====== # pretty print from autoindent and ased editor # human language root words calculator # written on Windows XP on eTCL # working under TCL version 8.5.6 and eTCL 1.0.1 # gold on TCL WIKI , 2may2014 package require Tk namespace path {::tcl::mathop ::tcl::mathfunc} frame .frame -relief flat -bg aquamarine4 pack .frame -side top -fill y -anchor center set names {{} { time years :} } lappend names { root words at time zero :} lappend names { root words remaining after t years: } lappend names { answers: minimum remaining root words from formula :} lappend names { ratio remaining roots over roots1(t=0):} lappend names { remaining roots percentage :} lappend names { language descendent criterion > 46% (0 or 1) :} foreach i {1 2 3 4 5 6 7} { label .frame.label$i -text [lindex $names $i] -anchor e entry .frame.entry$i -width 35 -textvariable side$i grid .frame.label$i .frame.entry$i -sticky ew -pady 2 -padx 1 } proc about {} { set msg " Human Language Root Words Calculator from TCL WIKI, written on eTCL " tk_messageBox -title "About" -message $msg } proc calculate { } { global answer2 global side1 side2 side3 side4 side5 global side6 side7 testcase_number incr testcase_number set years $side1 set roots1 $side2 set roots2 $side3 set exponent [/ $years 1000.] set kay [* [/ 86. 200. ] [exp 1. ]] set calcroots2 [/ [* $roots1 $kay ] [exp 1 ] ] set newratio [/ $calcroots2 $roots1 ] set newratio [/ $roots2 $roots1 ] set percentx [* $newratio 100. ] set passfaillogic 0. if { $percentx >= 46. } { set passfaillogic 1. } set calcroots2 [* [int $calcroots2 ] 1. ] set side4 $calcroots2 set side5 $newratio set side6 $percentx set side7 $passfaillogic return $side7 $passfaillogic } proc fillup {aa bb cc dd ee ff gg} { .frame.entry1 insert 0 "$aa" .frame.entry2 insert 0 "$bb" .frame.entry3 insert 0 "$cc" .frame.entry4 insert 0 "$dd" .frame.entry5 insert 0 "$ee" .frame.entry6 insert 0 "$ff" .frame.entry7 insert 0 "$gg"} proc clearx {} { foreach i {1 2 3 4 5 6 7} { .frame.entry$i delete 0 end } } proc reportx {} { global side1 side2 side3 side4 side5 global side6 side7 testcase_number console show; puts "%| table |printed in| tcl wiki format|% " puts "&| quantity| value| comment, if any|& " puts "&| testcase number| $testcase_number||& " puts "&| time in years at time zero :| $side1 ||&" puts "&| root words at time zero:| $side2 ||& " puts "&| root words after time (t2-t0) :| $side3 ||& " puts "&| answers: min. remaining root words fm formula :|$side4 ||&" puts "&| ratio remaining root words :| $side5 ||& " puts "&| remaining root words percentage:| $side6 ||&" puts "&| language descendent criterion > 46% (0 or 1) :| $side7 ||&" } frame .buttons -bg aquamarine4 ::ttk::button .calculator -text "Solve" -command { calculate } ::ttk::button .test2 -text "Testcase1" -command {clearx;fillup 1000. 200. 86. 85.0 0.43 43. 0. } ::ttk::button .test3 -text "Testcase2" -command {clearx;fillup 1000. 200. 120. 85.0 0.6 60. 1. } ::ttk::button .test4 -text "Testcase3" -command {clearx;fillup 1000. 200. 160. 85.0 0.8 80. 1. } ::ttk::button .clearallx -text clear -command {clearx } ::ttk::button .about -text about -command about ::ttk::button .cons -text report -command { reportx } ::ttk::button .exit -text exit -command {exit} pack .calculator -in .buttons -side top -padx 10 -pady 5 pack .clearallx .cons .about .exit .test4 .test3 .test2 -side bottom -in .buttons grid .frame .buttons -sticky ns -pady {0 10} . configure -background aquamarine4 -highlightcolor brown -relief raised -border 30 wm title . "Human Language Root Words Calculator" ====== *** Pushbutton Operation*** ---- For the push buttons, the recommended procedure is push testcase and fill frame, change first three entries etc, push solve, and then push report. Report allows copy and paste from console, but takes away from computer "efficiency". For testcases in a computer session, the eTCL calculator increments a new testcase number internally, eg. TC(1), TC(2) , TC(3) , TC(N). The testcase number is internal to the calculator and will not be printed until the report button is pushed for the current result numbers (which numbers will be cleared on the next solve button.) The command { calculate; reportx } or { calculate ; reportx; clearx } can be added or changed to report automatically, but is not recommended as computer efficiency is impaired. Another wrinkle would be to print out the current text, delimiters, and numbers in a TCL wiki style table as ====== puts " %| testcase $testcase_number | value| units |comment |%" puts " &| volume| $volume| cubic meters |based on length $side1 and width $side2 |&" ====== ---- **Comments Section** Please place any comments here, Thanks. <> <> Numerical Analysis | Toys | Calculator | Mathematics| Example