Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
AutoAbbreviations(line){
|
||||
len := prev := 0
|
||||
Days := StrSplit(line, " ")
|
||||
loop % StrLen(Days.1)
|
||||
{
|
||||
obj := []
|
||||
for j, day in Days
|
||||
{
|
||||
abb := SubStr(day, 1, len)
|
||||
obj[abb] := (obj[abb] ? obj[abb] : 0) + 1
|
||||
if (obj[abb] > 1)
|
||||
{
|
||||
len++
|
||||
break
|
||||
}
|
||||
}
|
||||
if (prev = len)
|
||||
break
|
||||
prev := len
|
||||
}
|
||||
return len
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
data := "
|
||||
(
|
||||
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
|
||||
|
||||
Sondag Maandag Dinsdag Woensdag Donderdag Vrydag Saterdag
|
||||
E_djelë E_hënë E_martë E_mërkurë E_enjte E_premte E_shtunë
|
||||
Ehud Segno Maksegno Erob Hamus Arbe Kedame
|
||||
Al_Ahad Al_Ithinin Al_Tholatha'a Al_Arbia'a Al_Kamis Al_Gomia'a Al_Sabit
|
||||
)"
|
||||
|
||||
for i, line in StrSplit(data, "`n", "`r")
|
||||
{
|
||||
line := RegExReplace(line, "\s+", " ")
|
||||
len := AutoAbbreviations(line)
|
||||
abbrev := ""
|
||||
for j, day in StrSplit(line, " ")
|
||||
abbrev .= SubStr(day, 1, len) " "
|
||||
result .= len " > " abbrev "`n"
|
||||
}
|
||||
MsgBox % result
|
||||
return
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Loop, Read, days-of-the-week.txt ; input text in current dir
|
||||
{
|
||||
if (A_Index > 10) ; number of lines to output
|
||||
break
|
||||
Loop, Parse, A_LoopReadLine, %A_Space% ; create an array of the days
|
||||
word%A_Index% := A_LoopField ; word1=sunday, word2=monday ...
|
||||
loop
|
||||
{
|
||||
x := A_Index ;save the last loop index
|
||||
abrev := ""
|
||||
loop 7
|
||||
abrev .= SubStr(word%A_Index%, 1, x) . "," ; x = length to test (1,2,3...)
|
||||
sort, abrev, U D, ; sort unique (errorlevel = duplicates)
|
||||
}
|
||||
until ErrorLevel = 0 ;stay with last loop index (length)
|
||||
minimalAb .= x . " " . A_LoopReadLine . " (" . abrev . ")`n"
|
||||
}
|
||||
msgbox % minimalAb
|
||||
ExitApp
|
||||
Loading…
Add table
Add a link
Reference in a new issue