mirror of
https://github.com/pragma-/pbot.git
synced 2025-12-23 11:28:12 +01:00
Plugin/Wordle: add Dutch language
This commit is contained in:
parent
235f6332a8
commit
6282008a61
341216
data/wordle/dutch
Normal file
341216
data/wordle/dutch
Normal file
File diff suppressed because it is too large
Load Diff
@ -81,6 +81,11 @@ my %wordlists = (
|
|||||||
wlist => '/wordle/canadian',
|
wlist => '/wordle/canadian',
|
||||||
glist => ['insane', 'british', 'urban'],
|
glist => ['insane', 'british', 'urban'],
|
||||||
},
|
},
|
||||||
|
dutch => {
|
||||||
|
name => 'Dutch',
|
||||||
|
prompt => 'Raad het Nederlandse woord!',
|
||||||
|
wlist => '/wordle/dutch',
|
||||||
|
},
|
||||||
finnish => {
|
finnish => {
|
||||||
name => 'Finnish',
|
name => 'Finnish',
|
||||||
prompt => 'Arvaa suomenkielinen sana!',
|
prompt => 'Arvaa suomenkielinen sana!',
|
||||||
|
|||||||
@ -25,8 +25,8 @@ use PBot::Imports;
|
|||||||
# These are set by the /misc/update_version script
|
# These are set by the /misc/update_version script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 4929,
|
BUILD_REVISION => 4931,
|
||||||
BUILD_DATE => "2025-12-19",
|
BUILD_DATE => "2025-12-20",
|
||||||
};
|
};
|
||||||
|
|
||||||
sub initialize {}
|
sub initialize {}
|
||||||
|
|||||||
50
misc/quotegrabs/import-quotegrabs-from-html.py
Executable file
50
misc/quotegrabs/import-quotegrabs-from-html.py
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import requests
|
||||||
|
import csv
|
||||||
|
import datetime
|
||||||
|
import time
|
||||||
|
import re
|
||||||
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
#url = 'https://www.iso-9899.info/candide/quotegrabs.html'
|
||||||
|
#response = requests.get(url)
|
||||||
|
|
||||||
|
with open('quotegrabs.html', 'r') as file:
|
||||||
|
soup = BeautifulSoup(file, 'html.parser')
|
||||||
|
|
||||||
|
channels = soup.find_all('h3')
|
||||||
|
|
||||||
|
with open('quotes.csv', 'w', newline='') as csvfile:
|
||||||
|
writer = csv.writer(csvfile)
|
||||||
|
|
||||||
|
for channel in channels:
|
||||||
|
table = channel.find_next_sibling('table')
|
||||||
|
rows = table.find_all('tr')
|
||||||
|
|
||||||
|
for row in rows:
|
||||||
|
print(row)
|
||||||
|
tds = row.find_all('td')
|
||||||
|
if len(tds) != 5: continue
|
||||||
|
id, authors, text, date, grabber = [td.text for td in tds]
|
||||||
|
first_author = authors.split(', ')[0]
|
||||||
|
timestamp = time.mktime(datetime.datetime.strptime(date, '%Y/%m/%d %a %H:%M:%S').timetuple())
|
||||||
|
|
||||||
|
if text[0] == '<':
|
||||||
|
text = re.sub(r'^<[^>]+> ', '', text, count=1)
|
||||||
|
else:
|
||||||
|
text = re.sub(r'^\* ([^\s]+)', '/me', text, count=1)
|
||||||
|
|
||||||
|
messages = []
|
||||||
|
authors = []
|
||||||
|
|
||||||
|
for i, message in enumerate(text.split(' ')):
|
||||||
|
message = message.strip()
|
||||||
|
author = re.match(r'^\* ([^ ]+)', message) or re.match(r'<([^>]+)>', message)
|
||||||
|
print(author, message)
|
||||||
|
if i > 0 and not author: continue
|
||||||
|
author = author.group(1) if i > 0 else first_author
|
||||||
|
authors.append(author)
|
||||||
|
|
||||||
|
print(authors, text)
|
||||||
|
writer.writerow([id, '+'.join(authors), channel.text, grabber, text, timestamp])
|
||||||
1
misc/wordle/filter
Executable file
1
misc/wordle/filter
Executable file
@ -0,0 +1 @@
|
|||||||
|
for f in *; do cat $f | perl -ne '$x = $_; chomp $x; next if not $x =~ /^[a-z]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/$f; done
|
||||||
1
misc/wordle/filter_dutch
Executable file
1
misc/wordle/filter_dutch
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat dutch | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-z]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/dutch
|
||||||
2
misc/wordle/filter_finnish
Executable file
2
misc/wordle/filter_finnish
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
cat finnish | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-zåäöšž]+$/; print "$x\n" if length $x >= 5 && length $x <= 8' > filtered/finnish
|
||||||
|
|
||||||
1
misc/wordle/filter_french
Executable file
1
misc/wordle/filter_french
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat french | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-zéàèùçâêîôûëïü]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/french
|
||||||
1
misc/wordle/filter_german
Executable file
1
misc/wordle/filter_german
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat german | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[A-Z]?[a-zäÄöÖüÜßẞ]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/german
|
||||||
1
misc/wordle/filter_italian
Executable file
1
misc/wordle/filter_italian
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat italian | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-zàèéìòù]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/italian
|
||||||
1
misc/wordle/filter_ngerman
Executable file
1
misc/wordle/filter_ngerman
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat ngerman | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[A-Z]?[a-zäÄöÖüÜßẞ]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/german
|
||||||
2
misc/wordle/filter_polish
Executable file
2
misc/wordle/filter_polish
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
cat polish | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-zćńóśźżąęł]+$/; print "$x\n" if length $x >= 3 && length $x <= 8' > filtered/polish
|
||||||
|
|
||||||
1
misc/wordle/filter_spanish
Executable file
1
misc/wordle/filter_spanish
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat spanish | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-záéíóúüñ]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/spanish
|
||||||
1
misc/wordle/filter_udict
Executable file
1
misc/wordle/filter_udict
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat udict_full | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[A-Z]?[a-z]+$/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/urban
|
||||||
1
misc/wordle/filter_urban
Executable file
1
misc/wordle/filter_urban
Executable file
@ -0,0 +1 @@
|
|||||||
|
cat urban | perl -CIO -Mutf8 -ne 'use feature "unicode_strings"; $x = $_; chomp $x; next if not $x =~ /^[a-z]+$/; next if $x =~ /(\w)\1{2,}/; print "$x\n" if length $x >= 3 && length $x <= 22' > filtered/urban
|
||||||
Loading…
x
Reference in New Issue
Block a user