Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,35 +0,0 @@
|
|||
function Reverse-String ([string]$String)
|
||||
{
|
||||
[char[]]$output = $String.ToCharArray()
|
||||
[Array]::Reverse($output)
|
||||
$output -join ""
|
||||
}
|
||||
|
||||
[string]$url = "http://www.puzzlers.org/pub/wordlists/unixdict.txt"
|
||||
[string]$out = ".\unixdict.txt"
|
||||
|
||||
(New-Object System.Net.WebClient).DownloadFile($url, $out)
|
||||
|
||||
[string[]]$file = Get-Content -Path $out
|
||||
|
||||
[hashtable]$unixDict = @{}
|
||||
[hashtable]$semordnilap = @{}
|
||||
|
||||
foreach ($line in $file)
|
||||
{
|
||||
if ($line.Length -gt 1)
|
||||
{
|
||||
$unixDict.Add($line,"")
|
||||
}
|
||||
|
||||
[string]$reverseLine = Reverse-String $line
|
||||
|
||||
if ($reverseLine -notmatch $line -and $unixDict.ContainsKey($reverseLine))
|
||||
{
|
||||
$semordnilap.Add($line,$reverseLine)
|
||||
}
|
||||
}
|
||||
|
||||
$semordnilap
|
||||
|
||||
"`nSemordnilap count: {0}" -f ($semordnilap.GetEnumerator() | Measure-Object).Count
|
||||
Loading…
Add table
Add a link
Reference in a new issue