<commit_before>--[[

This module holds datas for those Pokémon that has both Alt and Useless forms.
When possible, takes datas from the other alternative forms modules.

--]]

local t = {}
local txt = require('Wikilib-strings') -- luacheck: no unused
local tab = require('Wikilib-tables') -- luacheck: no unused
local alt = require("AltForms-data")
local useless = require("UselessForms-data")

--[[

Automatically merges alt and useless forms data of a certain Pokémon.
Merges names, links, blacklinks, ext, since and (if needed) until. Doesn't
merge gamesOrder because it can't know how to sort it.

--]]
local function mergeByName(poke)
    local res = {}

    -- Table.copy is needed because table.merge doesn't work on
    -- mw.loadDataed tables.
    res.names = table.merge(table.copy(alt[poke].names),
                            table.copy(useless[poke].names))

    res.links = table.merge(table.copy(alt[poke].links),
                            table.copy(useless[poke].links))

    res.blacklinks = table.merge(table.copy(alt[poke].blacklinks),
                                 table.copy(useless[poke].blacklinks))

    res.ext = table.merge(table.copy(alt[poke].ext),
                          table.copy(useless[poke].ext))
<commit_msg>fixup! Adding plain links to AltForms-data and PokémonData<commit_after>--[[

This module holds datas for those Pokémon that has both Alt and Useless forms.
When possible, takes datas from the other alternative forms modules.

--]]

local t = {}
local txt = require('Wikilib-strings') -- luacheck: no unused
local tab = require('Wikilib-tables') -- luacheck: no unused
local alt = require("AltForms-data")
local useless = require("UselessForms-data")

--[[

Automatically merges alt and useless forms data of a certain Pokémon.
Merges names, links, blacklinks, ext, since and (if needed) until. Doesn't
merge gamesOrder because it can't know how to sort it.

--]]
local function mergeByName(poke)
    local res = {}

    -- Table.copy is needed because table.merge doesn't work on
    -- mw.loadDataed tables.
    res.names = table.merge(table.copy(alt[poke].names),
                            table.copy(useless[poke].names))

    res.links = table.merge(table.copy(alt[poke].links),
                            table.copy(useless[poke].links))

    res.blacklinks = table.merge(table.copy(alt[poke].blacklinks),
                                 table.copy(useless[poke].blacklinks))

    res.plainlinks = table.merge(table.copy(alt[poke].plainlinks),
                                 table.copy(useless[poke].plainlinks))

    res.ext = table.merge(table.copy(alt[poke].ext),
                          table.copy(useless[poke].ext))

{'fraction_non_alphanumeric': 0.12053571428571429, 'fraction_numerical': 0.0, 'mean_word_length': 2.760839160839161, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '304585', 'n_tokens_mistral': 813, 'n_tokens_neox': 784, 'n_words': 218}