Learning English From Android Source Code:2 Ampersand
这一次想把标点符号的英语表达总结一下,这些单词非常重要但easy被我们忽视。以我的经验,还是多认识几个。以备不时之需。
以下从“标点符号”開始:
punctuation
[英][ˌpʌŋktʃuˈeɪʃn][美][ˌpʌŋktʃuˈeʃən]
n.标点法; 标点符号; 标点符号的使用; 点标点;
ampersand
[英][ˈæmpəsænd][美][ˈæmpərsænd]
n."&"的记号名称,and符;
源代码中使用:
出自frameworks/base/core/java/android/net/UrlQuerySanitizer.java
609 /**
610 * Parse a query. A query string is any number of parameter-value clauses
611 * separated by any non-zero number of ampersands. A parameter-value clause
612 * is a parameter followed by an equal sign, followed by a value. If the
613 * equal sign is missing, the value is assumed to be the empty string.
614 * @param query the query to parse.
615 */
616 public void parseQuery(String query) {
617 clear();
618 // Split by '&'
619 StringTokenizer tokenizer = new StringTokenizer(query, "&");
620 while(tokenizer.hasMoreElements()) {//解析工作被放在while循环中,与xml的解析相似
621 String attributeValuePair = tokenizer.nextToken();
622 if (attributeValuePair.length() > 0) {
623 int assignmentIndex = attributeValuePair.indexOf('=');
624 if (assignmentIndex < 0) {
625 // No assignment found, treat as if empty value
626 parseEntry(attributeValuePair, "");
627 }
628 else {
629 parseEntry(attributeValuePair.substring(0, assignmentIndex),
630 attributeValuePair.substring(assignmentIndex + 1));
631 }
632 }
633 }
634 }
先说说clauses这个词和文件名称UrlQuerySanitizer,然后再尝试翻译parseQuery方法的凝视。
clause
[英][klɔ:z][美][klɔz]
n.从句,分句; 条款,款项; 【计】子句
凝视中是对字符串的解析,那么这里译成从句或子句更好一些。
一个条款的例句:What clause do you require in the contract(合同)?
Sanitizer
这个词比較有趣。由于直接翻看词典的解释为消毒杀菌剂,清扫车。跟本文貌似不太搭噶。
我再看sanitize的翻译。vt.使清洁。 进行消毒; 审查; 净化。也有对其审查之意。
结合上下文,这个类的作用是对URL请求检查或清理,那么这里译成审查者我觉得还不错。哪位有更好的建议欢迎赐教。
凝视的翻译例如以下:
解析一个请求。这个请求字符串被随意的非零的‘&’符分成随意数字的參数值子句(And符就是拆分标识)。
一个參数值子句是一个參数后面跟一个等号。然后再跟一个值。假设等号没有了,后面的值就会被觉得是空。
Learning English From Android Source Code:2 Ampersand的更多相关文章
- Learning English From Android Source Code:1
英语在软件行业的重要作用不言自明,尤其是做国际项目和写国际软件,好的英语表达是项目顺利进行的必要条件.纵观眼下的IT行业.可以流利的与国外客户英文口语交流的程序猿占比并非非常高.要想去国际接轨,语言这 ...
- Learning from the CakePHP source code - Part I
最近开始痛定思痛,研究cakephp的源码. 成长的路上从来没有捷径,没有小聪明. 只有傻傻的努力,你才能听到到成长的声音. 下面这篇文章虽然过时了,但是还是可以看到作者的精神,仿佛与作者隔着时空的交 ...
- Troubles in Building Android Source Code
Some Troubles or problems you may encounter while you setup the Android source code build environmen ...
- Android Source Code
一. Android 框架 http://elinux.org/Master-android Android框架层级 : Android 自下 而 上 分为 4层; -- Linux内核层; -- 各 ...
- Learning from the CakePHP source code - Part II
原文:http://debuggable.com/posts/learning-from-the-cakephp-source-code-part-ii:480f4dd6-57fc-4715-8709 ...
- Google android source code build 问题总结【转】
本文转载自:http://light3moon.com/2015/01/31/Google%20android%20source%20code%20build%20%E9%97%AE%E9%A2%98 ...
- Increasing heap size while building the android source code on Ubuntu 15.10
http://stackoverflow.com/questions/34940793/increasing-heap-size-while-building-the-android-source-c ...
- Android source code compile error: “Try increasing heap size with java option '-Xmx<size>'”
export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g" ./pr ...
- android activity 启动过程分析(source code 4.4)
说实话,android source code从2.3到4.4变化是蛮多的,尤其是media部分,虽然总的框架是没有多大变化,但是找起代码来看还是挺麻烦的.在android里面最受伤的是使用了java ...
随机推荐
- Dinic 算法钩沉
最初是从<挑战程序设计竞赛>上了解到 Dinic 算法的.其中对于 Dinic 算法中的关键词--分层图(layered network,也称『层次图』)的引入的解释如下: 因为最短增广路 ...
- chromedriver对应的支持的Chrome版本(更新至Chrome64)
很多网友在配置chromedriver的时候会遇到很多麻烦,在网上找了很多资料觉得这个表格不错,就给大家分享出来,希望对大家配置chrome的时候有帮助: chromedriver版本 支持的Chro ...
- P1382 楼房 (扫描线,线段树)
题目描述 地平线(x轴)上有n个矩(lou)形(fang),用三个整数h[i],l[i],r[i]来表示第i个矩形:矩形左下角为(l[i],0),右上角为(r[i],h[i]).地平线高度为0.在轮廓 ...
- scrapy之Pipeline
官方文档:https://docs.scrapy.org/en/latest/topics/item-pipeline.html 激活pipeline,需要在settings里配置,然而这里配置的pi ...
- 计算器(bzoj 2242)
Description 你被要求设计一个计算器完成以下三项任务: 1.给定y,z,p,计算Y^Z Mod P 的值: 2.给定y,z,p,计算满足xy≡ Z ( mod P )的最小非负整数: 3.给 ...
- word文档的导出(用freemarker模板导出)(桃)
1.将要导出的word文档另存为xml格式的 2.用文档编辑器打开(如:notepad++),将要展示的数据用${name}的形式替换,“name”对应数据库中的字段 3.根据模板生成 package ...
- windows8.1如何分盘
磁盘分区首先要弄明白磁盘物理顺序与逻辑顺序的区别,在[磁盘管理]界面,所显示的前后顺序为物理顺序,这是磁盘上实实在在的物理位置,如下图2的电脑磁盘物理顺序为CFDE.在[资源管理器]界面,所显示的顺序 ...
- mybatis传入map参数,map中包含list(输入参数)
1.xml中配置: <!-- 根据条件查询满足条件的ID集合开始 --> <select id="getQuestionsIdsForExamPaper" res ...
- WebRTC 介绍 (转)
google开源了WebRTC项目,网址是:http://code.google.com/p/webrtc/. WebRTC实现了基于网页的视频会议,标准是WHATWG 协议,目的是通过浏览器提供简单 ...
- 从反汇编看待C++ new
首先来看最简单的new操作 int main() { int *temp = new int; delete temp; } 反汇编结果:调用了operator new 00311C9E push 4 ...