text
----
h
he
hel // All above are prefixes
helll123 // hel is a prefix of helll123; this is the first occurence of helll123
helll123 // second helll123
f
fa
fals
falst0 // fals is a prefix of falst0
下面的查詢是僞代碼來說明我是什麼之後
SELECT
unique_by_prefix(text) AS unique_text, // pseudo code
count(*)
FROM
my_table
GROUP BY 1
應該產生以下結果
unique_text count
helll123 2
falst0 1
基本上,我們會忽略前綴並只計算唯一的文本。
你怎麼能告訴這是一個前綴,這是一個字?應該有一些規則。 –
我其實並沒有試圖去區分它是否是一個詞。我會更新這個問題。我會忽略任何前綴或其他東西 – samol