-
Notifications
You must be signed in to change notification settings - Fork 1
/
distlib.sqbpro
84 lines (61 loc) · 3.81 KB
/
distlib.sqbpro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0" encoding="UTF-8"?><sqlb_project><db path="C:/Users/schiffma/Google Drive/GitHub/distlib/distlib.db" readonly="0" foreign_keys="0" case_sensitive_like="0" temp_store="0" wal_autocheckpoint="0" synchronous="1"/><attached/><window><main_tabs open="structure browser pragmas query" current="3"/></window><tab_structure><column_width id="0" width="300"/><column_width id="1" width="0"/><column_width id="2" width="100"/><column_width id="3" width="735"/><column_width id="4" width="0"/><expanded_item id="0" parent="1"/><expanded_item id="1" parent="1"/><expanded_item id="2" parent="1"/><expanded_item id="3" parent="1"/></tab_structure><tab_browse><current_table name="4,8:mainperm_gen"/><default_encoding codec=""/><browse_table_settings><table schema="main" name="perm_gen" show_row_id="0" encoding="" plot_x_axis="" unlock_view_pk="_rowid_"><sort/><column_widths><column index="1" value="52"/><column index="2" value="72"/></column_widths><filter_values/><conditional_formats/><row_id_formats/><display_formats/><hidden_columns/><plot_y_axes/><global_filter/></table></browse_table_settings></tab_browse><tab_sql><sql name="SQL 1">select lsim('kitten','sitting');
select lsim('Clark Kent','Claire Kent');
select lsim('Clärk Kent','Cläire Kent');
select jsim('Peter Parker','Pete Parker');
select jsim('Péter Pärker','Péte Pärker');
select jwsim('Peter Parker','Pete Parker');
select jwsim('Péter Pärker','Péte Pärker');
select lsim('a cat','an act');
select jsim('Clark Kent','Claire Kent');
select lcstr('carpenter', 'sharpener');
select lcstrl('carpenter', 'sharpener');
select lcseq('cärpenter', 'shärpener');
select lcseql('cärpenter', 'shärpener');
select * from subseq('ABC');
WITH orig_ AS (SELECT 'Z''Hansrüed' AS orig),
perm_ AS (SELECT orig, permut FROM perm(orig) JOIN orig_ ON 1=1)
SELECT * FROM perm_;
DROP TABLE IF EXISTS perm_gen;
CREATE TABLE IF NOT EXISTS perm_gen AS
WITH orig_ AS (SELECT 'Gerät' AS orig),
perm_ AS (SELECT orig, permut FROM perm(orig) JOIN orig_ ON 1=1)
SELECT * FROM perm_;
WITH orig_ AS (SELECT 'Geräte' AS orig),
perm_ AS (SELECT orig, permut FROM perm(orig) JOIN orig_ ON 1=1)
SELECT * FROM (
SELECT orig, permut, lcstr(orig, permut) lcstr, lcstrl(orig, permut) lcstrl,
lcseq(orig, permut) lcseq, lcseql(orig, permut) lcseql FROM perm_
) ORDER BY lcstrl desc, lcseql desc;
SELECT lcstr('Geräte','tGeäer');
WITH orig_ AS (SELECT 'Geräte' AS orig),
subseq_ AS (SELECT orig, subseq FROM subseq(orig) JOIN orig_ ON 1=1)
SELECT * FROM (
SELECT orig, subseq, lcstr(orig, subseq) lcstr, lcstrl(orig, subseq) lcstrl,
lcseq(orig, subseq) lcseq, lcseql(orig, subseq) lcseql FROM subseq_
) ORDER BY lcstrl desc, lcseql desc;
--CREATE TABLE IF NOT EXISTS perm_test AS
--WITH orig_ AS (SELECT 'Z''Hansrüedi' AS orig),
--perm_ AS (SELECT orig, permut FROM perm(orig) JOIN orig_ ON 1=1)
--SELECT * FROM perm_;
--SELECT orig, permut, lcstr(orig, permut) lcstr
--,lcseq(orig, permut) lcseq
--FROM perm_gen;
DROP TABLE IF EXISTS perm_test;
CREATE TABLE IF NOT EXISTS perm_test AS
SELECT orig, permut, lcstr(orig, permut) lcstr, lcseq(orig, permut) lcseq ,
lcstrl(orig, permut) lcstrl, lcseql(orig, permut) lcseql, lsim(orig, permut) lsim,
dlsim(orig, permut) dlsim, jsim(orig, permut) jsim, jwsim(orig, permut) jwsim FROM perm_gen
;
--SELECT * FROM perm_test;
DROP TABLE IF EXISTS subseq_gen;
CREATE TABLE IF NOT EXISTS subseq_gen AS
WITH orig_ AS (SELECT 'Lückenbüßer' AS orig),
subseq_ AS (SELECT orig, subseq FROM subseq(orig) JOIN orig_ ON 1=1)
SELECT * FROM subseq_;
DROP TABLE IF EXISTS subseq_test;
CREATE TABLE IF NOT EXISTS subseq_test AS
SELECT orig, subseq, lcstr(orig, subseq) lcstr, lcstrl(orig, subseq) lcstrl, lsim(orig, subseq) lsim,
dlsim(orig, subseq) dlsim, jsim(orig, subseq) jsim, jwsim(orig, subseq) jwsim from subseq_gen
;
VACUUM;
</sql><current_tab id="0"/></tab_sql></sqlb_project>