Learning 中文版 from Android Source code:2 Ampersand

Source: Internet
Author: User

This time I want to summarize the English expression of punctuation, these words are very important but easy is overlooked by us. In my experience, I still know a few more. For a rainy future.

Here's how to start 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;

Used in 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 of 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 say clauses the word and file name Urlquerysanitizer, and then try to translate the gaze of the Parsequery method.

Clause

British [Kl?:z] Beauty [Kl?z]
N. Subordinate clauses and clauses; terms, payments; "GAUGE" clause
In the gaze is the parsing of the strings, so it is better to translate them into clauses or clauses.

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

Sanitizer

This word is more interesting. As the direct turn to read the explanation of the dictionary as a disinfectant, cleaning car. It seems that this article is not very good karma.

I'll see Sanitize's translation again. Vt. Make clean. To sterilize, examine, or purify. There are also implications for its review.

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 gaze is for example the following:

Resolves a request. This request string is divided into random numbers by random non-zero ' & ' (the ampersand is the split identifier).

A value clause is a parameter followed by an equal sign. And then one more value. Assuming that the equals sign is gone, the value that follows will be 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.