Module talk:User:kc kennylau/ancestor chain

This is really cool, not to mention useful. —Aryamanarora (मुझसे बात करो) 22:20, 11 February 2016 (UTC)
 * : Thanks. --kc_kennylau (talk) 14:35, 12 February 2016 (UTC)

Possible improvements
I wonder if this could be made into a combined ancestor/family chain, so that languages are grouped in families even if there is no proto-language for them. I imagine that working out the "parent" of a language in a branch would work as follows: When a family has a proto-language, perhaps both the family and its proto-language could be shown side by side. —CodeCat 01:27, 15 February 2016 (UTC)
 * 1) If there is an ancestor specified for the language, use that.
 * 2) Otherwise, use the proto-language of the family.
 * 3) If the family has no proto-language, use the family directly.


 * This is a great idea and one that I had intend to suggest in one form or another. — JohnC5 01:52, 15 February 2016 (UTC)


 * I can suggest an improvement to this: If a family is given in the lua field, then treat it the same way with steps 2 and 3. --WikiTiki89 19:26, 17 February 2016 (UTC)
 * Families can't be ancestors. If you want to specify the family, then specify it as . —CodeCat 20:06, 17 February 2016 (UTC)
 * What I mean is, you should be able to get the same functionality both implicitly and explicitly. And the functionality I'm referring to is "When a family has a proto-language, perhaps both the family and its proto-language could be shown side by side". --WikiTiki89 20:19, 17 February 2016 (UTC)
 * Yes, but it's not possible to fill in a family in the ancestor field. Only languages can go there. —CodeCat 20:58, 17 February 2016 (UTC)
 * I know that it's not possible, that's why I'm saying that maybe it should be possible. --WikiTiki89 21:15, 17 February 2016 (UTC)
 * The behavior has just been updated so that in the absence of an explicit ancestor, the language module uses its family's proto-language, if any. This has the exact same effect as what you are suggesting. — JohnC5 21:19, 17 February 2016 (UTC)
 * Please read my comment of 20:19, 17 February 2016. --WikiTiki89 21:23, 17 February 2016 (UTC)
 * Yes, it just seems redundant to me to mark it explicitly if it is calculated implicitly. — JohnC5 21:27, 17 February 2016 (UTC)
 * Unless in a particular exceptional scenario we want the language's family to be different from the language's ancestor. Or, if we want to add multiple ancestors, such as we already do for some creole languages, we would want them to have the same functionality of displaying both the families and the ancestors. --WikiTiki89 16:36, 18 February 2016 (UTC)


 * I agree with CodeCat, it's illogical to specify a family in the ancestor= rather than the family= field, especially because it seems like the only reason we'd be doing so would be to make this one page neater. - -sche (discuss) 22:18, 17 February 2016 (UTC)

Could we possibly implement the “If the family has no proto-language, use the family directly” functionality here or does that need to be done in mod:languages? — JohnC5 15:22, 14 April 2016 (UTC)

Oh no!

 * Could we make this more efficient, because we now have a problem of it overflowing the runtime limit. — JohnC5 19:51, 21 February 2016 (UTC)
 * Did I break something? It all started after this edit. --Vahag (talk) 19:52, 21 February 2016 (UTC)
 * no, I think you are fine. This process it just staggeringly expensive, and its execution just takes too long. I'm wondering whether there might be a better algorithm that would be more efficient. — JohnC5 19:57, 21 February 2016 (UTC)
 * Why is then Category:Lezghian languages in error? Does Kenneth's ancestor chain have anything to do with it? --Vahag (talk) 19:58, 21 February 2016 (UTC)
 * Yep, didn't even notice that. A language family may not have itself as its ancestor family. Thither lies infinite recursion. I'm not sure if I categorized it correctly though. — JohnC5 20:13, 21 February 2016 (UTC)
 * You categorized correctly, thank you. Sorry, everybody, for breaking Wiktionary. --Vahag (talk) 20:17, 21 February 2016 (UTC)
 * I'm still cleaning up from when I did it yesterday. Please continue! :) — JohnC5 20:33, 21 February 2016 (UTC)

Viewing part of the tree
Is there any way to just view part of the tree? My Lua is pretty bad. I've been reorganizing the New Indo-Aryan languages and this would be immensely useful. —Aryaman (मुझसे बात करो) 22:00, 16 November 2017 (UTC)
 * , are you clever enough to get this module working again? I sure ain't. You can even edit my copy over at Module:User:JohnC5/Sandbox2. — JohnC5 22:12, 16 November 2017 (UTC)
 * Your version is now below the memory limit after Erutuon's edits. —Aryaman (मुझसे बात करो) 22:54, 16 November 2017 (UTC)
 * Sweet, only 20 mb now! That's really impressive . —Aryaman (मुझसे बात करो) 22:55, 16 November 2017 (UTC)
 * Thanks! So, you would like to be able to make a tree of descendants for a specific language or family? I can work on that now. — Eru·tuon 23:05, 16 November 2017 (UTC)
 * I just suggested that in case the memory errors were unavoidable. User:AryamanA/sandbox2 is more than functional for me, thanks so much! —Aryaman (मुझसे बात करो) 23:06, 16 November 2017 (UTC)
 * Well, I thought it might be more convenient, since you are just working with one family. — Eru·tuon 23:19, 16 November 2017 (UTC)
 * For now I'm working with one family. I may also try to do something with the Iranian languages eventually. —AryamanA (मुझसे बात करें • योगदान) 23:20, 16 November 2017 (UTC)
 * Well, now, if you want, you can give the code for the language whose descendants you want to display in the first parameter. — Eru·tuon 23:51, 16 November 2017 (UTC)
 * Thanks for fixing this up! Could I convince you to have this module show the intermediate language families without protolanguages (i.e. East Germanic, South Slavic, etc.)? Thanks! — JohnC5 06:06, 17 November 2017 (UTC)
 * I can try. I don't really understand how everything works yet. — Eru·tuon 07:08, 17 November 2017 (UTC)
 * Also, something that one of has done has made language get repeated twice, as in the case of Proto-Brythonic in Module:User:JohnC5/Sandbox2. :V — JohnC5 09:45, 17 November 2017 (UTC)
 * It was lua, though I don't understand how... — Eru·tuon 10:08, 17 November 2017 (UTC)
 * Weird... — JohnC5 10:19, 17 November 2017 (UTC)

Okay, now the tree shows language families if there's no proto-language – and it exceeds the template include size. There are still bugs: Romance is included alongside Latin under Proto-Italic, for instance. I guess the logic needs improvement. — Eru·tuon 03:49, 18 November 2017 (UTC)
 * Thank you so much! This is really helpful because we can now see language families that don't have a protolanguage, which formerly was not possible. It still does have a bug: If you look under Proto-Indo-European, it lists both the protolanguage and the language family, where is should only list one (the protoloanguage if it exists, else the family). It would also be cool if we could color or mark the family names differently from the languages. Thanks again. — JohnC5 20:23, 18 November 2017 (UTC)
 * You can customize the display of language families in the lua function at the top of the module. There's a different lua for regular languages, etymology languages, and language families. — Eru·tuon 20:27, 18 November 2017 (UTC)
 * Gotcha. And the double display of family and protolanguage? — JohnC5 22:20, 18 November 2017 (UTC)
 * On second thought, the best option would be to display both the family and its protolanguage is they are both available. This way we can really see how the data is structured (i.e. whether Latin is coded as the protolanguage of Romance). — JohnC5 22:23, 18 November 2017 (UTC)
 * The creation of the tree is handled by lua, and because that returns "Proto-Italic" as the parent of both "Latin" and "Romance", both are included. Maybe creating a map from family to proto-language could be used to remove families if their proto-language is present.
 * I kind of do like having the families included, but it makes the tree so much bigger to have two nodes for family and proto-language. Maybe there should be both possibilities. — Eru·tuon 23:04, 18 November 2017 (UTC)
 * I like your adorable tree emoji. — JohnC5 02:11, 19 November 2017 (UTC)

Okay, now you can use the second parameter to make the tree show families that have proto-languages: for instance,. — Eru·tuon 23:48, 19 November 2017 (UTC)