Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -4,13 +4,13 @@ class BurrowsWheelerTransform{
|
|||
_assert_(not str.holds(special), "String cannot contain char \"%s\"".fmt(special) );
|
||||
str=str.append(special);
|
||||
str.len().pump(List().merge,'wrap(n){ String(str[n,*],str[0,n]) })
|
||||
.pump(String,T("get",-1)); // last char of each "permutation"
|
||||
.pump(String,T("get",-1)); // last char of each "permutation"
|
||||
}
|
||||
fcn decode(str){
|
||||
table:=List.createLong(str.len(),""); // ("",""..), mutable
|
||||
table:=List.createLong(str.len(),""); // ("",""..), mutable
|
||||
do(str.len()){
|
||||
foreach n in (str.len()){ table[n]=str[n] + table[n] }
|
||||
table.sort();
|
||||
foreach n in (str.len()){ table[n]=str[n] + table[n] }
|
||||
table.sort();
|
||||
} // --> ("$dogwood","d$dogwoo","dogwood$",...)
|
||||
table.filter1("%s*".fmt(special).glob)[1,*]; // str[0]==$, often first element
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue