ORACLE獲取漢字筆畫數

2021-10-17 14:41:31 字數 1796 閱讀 5185

create table tb_stroke(word varchar2(2),stroke_count number(2,0));

insert into tb_stroke(word,stroke_count)

select '一',1 from dual

union all

select '二',2 from dual

union all

select '口',3 from dual

union all

select '木',4 from dual

union all

select '禾',5 from dual

union all

select '眾',6 from dual

union all

select '沐',7 from dual

union all

select '和',8 from dual

union all

select '骨',9 from dual

union all

select '徐',10 from dual

union all

select '曹',11 from dual

union all

select '彭',12 from dual

union all

select '亂',13 from dual

union all

select '僊',14 from dual

union all

select '僵',15 from dual

union all

select '嚲',16 from dual

union all

select '償',17 from dual

union all

select '儭',18 from dual

union all

select '儳',19 from dual

union all

select '儶',20 from dual

union all

select '儷',21 from dual

union all

select '亹',22 from dual

union all

select '儽',23 from dual

union all

select '儾',24 from dual

union all

select '囔',25 from dual;

超過25的如下:圞灥

囖爨厵灩

灪爩齾齉

靐用法select max(stroke_count)+1 from tb_stroke where nlssort(word,'nls_sort=schinese_stroke_m')也可以寫函式

create or replace function get_stroke_count(f_word in varchar2 )

return int

asi int:=0;

begin

select max(stroke_count)+1 into i from tb_stroke where nlssort(word,'nls_sort=schinese_stroke_m')--測試

select get_stroke_count('甲') from dual;

--顯示5

select get_stroke_count('骨') from dual;

--顯示9

java獲取漢字筆畫數

前段時間做個專案,主要是中文驗證碼識別,分為了幾類問題,一類是得出某個漢字的筆畫數,在網上搜了一下,基本方法都是大同小異,都是通過查gb2312的字符集的筆劃列表。下面給出源 public intgetstrokecount char charcator if bytes.length 1 if b...

漢字的奧秘 獲取漢字的筆畫數

想想看,如果你需要在 裡面得到漢字的筆畫數,該怎麼辦呢?每到這個時候,我們就一直感慨咱漢字的複雜啊 網上搜了一下,能看到的解決方案大抵都是說把所有漢字的筆畫預先記錄好,然後去查詢 但這樣做顯然是有點麻煩的。那麼是否有更加好的方式呢?我找到了微軟最近發布的乙個international pack,發現...

漢字的奧秘 獲取漢字的筆畫數

想想看,如果你需要在 裡面得到漢字的筆畫數,該怎麼辦呢?每到這個時候,我們就一直感慨咱漢字的複雜啊 網上搜了一下,能看到的解決方案大抵都是說把所有漢字的筆畫預先記錄好,然後去查詢 但這樣做顯然是有點麻煩的。那麼是否有更加好的方式呢?我找到了微軟最近發布的乙個international pack,發現...