Learning 中文版 from Android Source code:2 Ampersand

Source: Internet
Author: User

This time to summarize the English expression of punctuation marks, these words are important but easy to ignore. In my experience, I still know a few more, in case of a rainy future. The following starts with "punctuation":

Punctuation

British [? p?? Kt?u?e?? n][Mei][?p?? Kt?u?e?? N

N. Punctuation method; Punctuation Use of punctuation marks; Dot punctuation;

Ampersand
British [?? Mp?s?nd][beauty [??] MP?RS?ND]
N. " & "The name of the token, and the ampersand;

Using the source code:

Originated from Frameworks/base/core/java/android/net/urlquerysanitizer.java

609    /**610      * Parse a query. A query string is any number of Parameter-value clauses611      * separated by any non-zero number of Amper Sands. A parameter-value clause612      * is a parameter followed by an equal sign, followed by a value. If the613      * equal sign was missing, the value is assumed to be the empty string.614     &NBSP ; * @param query the query to parse.615      */616     public void Parsequery (String query) {617 & nbsp       Clear () 618        //Split by ' & ' 619         Stringtoke Nizer tokenizer = new StringTokenizer (query, "&"), 620         while (tokenizer.hasmoreelements ()) {//parsing work is placed in a while loop, similar to parsing XML 621             String Attributevaluepair = Tokenizer.nexttoken () 622             if (Attributevaluepair.length () &Gt 0) {623                 int assignmentindex = attributevaluepair.indexof (' = '); 624                 if (Assignmentindex < 0) {625         &NBSP ;          //No assignment found, treat as if empty value626           & nbsp          Parseentry (Attributevaluepair, ""), 627                 }628                 else {629              /- nbsp     Parseentry (attributevaluepair.substring (0, Assignmentindex), 630                             attributevaluepair.substring (Assignmentindex + 1)) 631   &nbs P            }632            }633         }634   } 
First talk about the word clauses and the file name Urlquerysanitizer, and then try to translate the comments of the Parsequery method.

Clause

British [Kl?:z] Beauty [Kl?z]
N. Subordinate clauses and clauses; terms, payments; "GAUGE" clause
The comment is the parsing of the string, so it is better to translate it into a clause or clause.

Example of a clause: What clause does require in the contract (contract)?

Sanitizer

This word is more interesting, because the direct look into the dictionary as a disinfectant, cleaning the car, and this article seems to be not very good karma.

I'll look at Sanitize's translation, Vt. Cleaning, disinfection, review, purification, and censorship. In conjunction with the context, the role of this class is to request a URL check or cleanup, then translated into a reviewer I think it's good. Which one has better suggestions welcome to enlighten.

The translation of the comments is as follows:

Resolves a request. The request string is separated by any nonzero ' & ' as a parameter value clause of any number (the ampersand is a split identifier). A parameter value clause is a parameter followed by an equal sign, followed by a value. If the equals sign is gone, the subsequent value is considered empty.

Learning 中文版 from Android Source code:2 Ampersand

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.