狠狠撸

狠狠撸Share a Scribd company logo
fontconfig & libpinyin 介绍

                  Presented by
                  Peng Wu
                        Red Hat


License statement goes here. See https://fedoraproject.org/wiki/Licensing#Content_Licenses for acceptable licenses.
今日主题
1. fontconfig 介绍
2. libpinyin 介绍
3. libpinyin 解密
fontconfig 介绍
字体渲染组件
Gtk+
Pango
Cairo
Fontconfig
Freetype
Fontconfig 目标
根据查询条件选择最好的字体
  fc-match
根据查询条件列出匹配的字体
  fc-list
Fedora 上的 fontconfig 配置
 为每一种语言提供一个默认字体
  参考
  http://tagoh.fedorapeople.org/fonts/f18-
  defaultfonts.html
 绝大部分字体都使用统一的 fontconfig 配置格式
  http://fedoraproject.org/wiki/Packaging:FontsPolicy
  示例
    /usr/share/fontconfig/templates/
fonts-tweak-tool
libpinyin 介绍
libpinyin 项目信息
主页 : https://github.com/libpinyin
  包含 libpinyin 和 ibus-libpinyin 两个子项目
下载镜像 :
http://sourceforge.net/projects/libpinyin/
介绍 : Library to deal with pinyin
libpinyin 介绍
 libpinyin
   基于 n-gram 自然语言处理模型的输入法后端
   已经进入 Fedora 18 中
   仍然在改进当中? ;)
 libpinyin 的前端
   ibus-libpinyin
   fcitx-libpinyin
假想的拼音输入法
记录所有的拼音 / 句子到 2TB 关系数据库中 .
优点
 接近 100% 的正确率
缺点
 没有那么大的硬盘
 也没有那么强悍的 CPU
使用自然语言处理的技术来达到正确率和资源使
用量的折中
libpinyin 解密
开源输入法数学模型
Uni-gram:
  scim-pinyin
N-gram:
  libpinyin
scim-pinyin 模型示例
例子 : zhong'guo'ren
P( 中国人 |zhong'guo'ren)
= P( 中国人 )
= P( 中国 )*P( 人 )
= 0.001 * 0.001
= 1e-6
scim-pinyin 模型示例 ( 继续 )
 P( 种果人 |zhong'guo'ren)
 = P( 种果人 )
 = P( 种果 )*P( 人 )
 = 0.0001 * 0.001
 = 1e-7
 < 1e-6 = P( 中国人 |zhong'guo'ren)
 所以最终结果为中国人 .
libpinyin 模型示例
例子 : zhong'guo'ren

P( 中国人 |zhong'guo'ren)
= P( 中国人 ) *P(zhong'guo'ren| 中国人 )
= P( 中国 )*P( 人 | 中国 )*P(zhong'guo| 中
国 )*P(ren| 人 )
= 0.01 * 0.1 * 0.7 * 0.5
= 3.5*10^-4
libpinyin 模型示例 ( 继续 )
 P( 种果人 |zhong'guo'ren)
 = P( 种果人 )*P(zhong'guo'ren| 种果人 )
 = P( 种果 )*P( 人 | 种果 )*P(zhong'guo| 种
 果 )*P(ren| 人 )
 = 0.01 * 0.01 * 0.8 * 0.5
 = 4.0*10^-5
 < 3.5*10^-4 = P( 中国人 |zhong'guo'ren)
所以最终结果为中国人 .
libpinyin on Fedora 19 开发计划
 允许用户导入第三方词库
 更多 ...
总结
请使用 fonts-tweak-tool 来定制自己的桌面字体
将会在 Fedora 19 继续改进 libpinyin, 提供更好
的输入体验
Demo
问题 ?

                      Contact:
                      pwu at fedoraproject dot org
License statement goes here. See https://fedoraproject.org/wiki/Licensing#Content_Licenses for acceptable licenses.
Ad

Recommended

Y3CDS - Python class 01
Y3CDS - Python class 01
Ting-You Xu
?
10 檔案說明與處理
10 檔案說明與處理
shademoon
?
libpinyin
libpinyin
Peng Wu
?
Wayland intro with_i18n_hacks
Wayland intro with_i18n_hacks
Peng Wu
?
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Top 5 Mistakes to Avoid When Writing Apache Spark Applications
Cloudera, Inc.
?
Visual Design with Data
Visual Design with Data
Seth Familian
?
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
?
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
?
2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
?
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
?

More Related Content

Featured (20)

2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
?
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
?
2024 Trend Updates: What Really Works In SEO & Content Marketing
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
?
Storytelling For The Web: Integrate Storytelling in your Design Process
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
?
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
?
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
?
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
?
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
?
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
?
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
?
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
?
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
?
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
?
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
?
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
?
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
?
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
?
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
?

Fedora 18 release party