(tr, range)
| 54 | } |
| 55 | |
| 56 | function getPlurals(tr, range) { |
| 57 | let columnTitles = [...tr.childNodes].map(td => td.title); |
| 58 | let rules = Object.fromEntries(columnTitles.map(key => [key, []])); |
| 59 | |
| 60 | let td = tr.firstElementChild; |
| 61 | |
| 62 | let index = 1; |
| 63 | |
| 64 | do { |
| 65 | const category = td.title; |
| 66 | |
| 67 | let columns = td.hasAttribute('colspan') ? Number(td.getAttribute('colspan')) : 1; |
| 68 | |
| 69 | do { |
| 70 | rules[category].push(range[index]); |
| 71 | |
| 72 | index++; |
| 73 | } while (columns-- > 1); |
| 74 | } while ((td = td.nextElementSibling)); |
| 75 | |
| 76 | return rules; |
| 77 | } |
| 78 | |
| 79 | function extractTable(dom, integerTable, fractionTable) { |
| 80 | function extract(table) { |
no test coverage detected