Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
4 | 2 | 2 | 0.986 | ExpressionStatement |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 4 | 302 | Closure/closure/goog/i18n/bidiformatter.js |
2 | 4 | 387 | Closure/closure/goog/i18n/bidiformatter.js |
| ||||
/** * Formats a string of unknown directionality for use in HTML output of the * context directionality, so an opposite-directionality string is neither * garbled nor garbles what follows it. * The algorithm: estimates the directionality of input argument {@code str}. In * case its directionality doesn't match the context directionality, wraps it * with a 'span' tag and adds a "dir" attribute (either 'dir=rtl' or 'dir=ltr'). * If setAlwaysSpan(true) was used, the input is always wrapped with 'span', * skipping just the dir attribute when it's not needed. * * If {@code opt_dirReset}, and if the overall directionality or the exit * directionality of {@code str} are opposite to the context directionality, a * trailing unicode BiDi mark matching the context directionality is appened * (LRM or RLM). * * If !{@code opt_isHtml}, HTML-escapes {@code str} regardless of wrapping. * * @param {string} str The input text. * @param {boolean=} opt_isHtml Whether {@code str} is HTML / HTML-escaped. * Default: false. * @param {boolean=} opt_dirReset Whether to append a trailing unicode bidi mark * matching the context directionality, when needed, to prevent the possible * garbling of whatever may follow {@code str}. Default: true. * @return {string} Input text after applying the above processing. */ goog.i18n.BidiFormatter.prototype.spanWrap= function (str, opt_isHtml, opt_dirReset){ var dir= this.estimateDirection(str, opt_isHtml); return this.spanWrapWithKnownDir(dir, str, opt_isHtml, opt_dirReset); } ; |
| ||||
/** * Formats a string of unknown directionality for use in plain-text output of * the context directionality, so an opposite-directionality string is neither * garbled nor garbles what follows it. * As opposed to {@link #spanWrap}, this makes use of unicode BiDi formatting * characters. In HTML, its *only* valid use is inside of elements that do not * allow mark-up, e.g. an 'option' tag. * The algorithm: estimates the directionality of input argument {@code str}. * In case it doesn't match the context directionality, wraps it with Unicode * BiDi formatting characters: RLE{@code str}PDF for RTL text, and * LRE{@code str}PDF for LTR text. * * If {@code opt_dirReset}, and if the overall directionality or the exit * directionality of {@code str} are opposite to the context directionality, a * trailing unicode BiDi mark matching the context directionality is appended * (LRM or RLM). * * Does *not* do HTML-escaping regardless of the value of {@code opt_isHtml}. * The return value can be HTML-escaped as necessary. * * @param {string} str The input text. * @param {boolean=} opt_isHtml Whether {@code str} is HTML / HTML-escaped. * Default: false. * @param {boolean=} opt_dirReset Whether to append a trailing unicode bidi mark * matching the context directionality, when needed, to prevent the possible * garbling of whatever may follow {@code str}. Default: true. * @return {string} Input text after applying the above processing. */ goog.i18n.BidiFormatter.prototype.unicodeWrap= function (str, opt_isHtml, opt_dirReset){ var dir= this.estimateDirection(str, opt_isHtml); return this.unicodeWrapWithKnownDir(dir, str, opt_isHtml, opt_dirReset); } ; |
| |||
/** * Formats a string of unknown directionality for use in plain-text output of * the context directionality, so an opposite-directionality string is neither * garbled nor garbles what follows it. * As opposed to {@link #spanWrap}, this makes use of unicode BiDi formatting * characters. In HTML, its *only* valid use is inside of elements that do not * allow mark-up, e.g. an 'option' tag. * The algorithm: estimates the directionality of input argument {@code str}. * In case it doesn't match the context directionality, wraps it with Unicode * BiDi formatting characters: RLE{@code str}PDF for RTL text, and * LRE{@code str}PDF for LTR text. * * If {@code opt_dirReset}, and if the overall directionality or the exit * directionality of {@code str} are opposite to the context directionality, a * trailing unicode BiDi mark matching the context directionality is appended * (LRM or RLM). * * Does *not* do HTML-escaping regardless of the value of {@code opt_isHtml}. * The return value can be HTML-escaped as necessary. * * @param {string} str The input text. * @param {boolean=} opt_isHtml Whether {@code str} is HTML / HTML-escaped. * Default: false. * @param {boolean=} opt_dirReset Whether to append a trailing unicode bidi mark * matching the context directionality, when needed, to prevent the possible * garbling of whatever may follow {@code str}. Default: true. * @return {string} Input text after applying the above processing. */ /** * Formats a string of unknown directionality for use in HTML output of the * context directionality, so an opposite-directionality string is neither * garbled nor garbles what follows it. * The algorithm: estimates the directionality of input argument {@code str}. In * case its directionality doesn't match the context directionality, wraps it * with a 'span' tag and adds a "dir" attribute (either 'dir=rtl' or 'dir=ltr'). * If setAlwaysSpan(true) was used, the input is always wrapped with 'span', * skipping just the dir attribute when it's not needed. * * If {@code opt_dirReset}, and if the overall directionality or the exit * directionality of {@code str} are opposite to the context directionality, a * trailing unicode BiDi mark matching the context directionality is appened * (LRM or RLM). * * If !{@code opt_isHtml}, HTML-escapes {@code str} regardless of wrapping. * * @param {string} str The input text. * @param {boolean=} opt_isHtml Whether {@code str} is HTML / HTML-escaped. * Default: false. * @param {boolean=} opt_dirReset Whether to append a trailing unicode bidi mark * matching the context directionality, when needed, to prevent the possible * garbling of whatever may follow {@code str}. Default: true. * @return {string} Input text after applying the above processing. */ goog.i18n.BidiFormatter.prototype. [[#variable62e1d860]]= function (str,opt_isHtml,opt_dirReset) { var dir=this.estimateDirection(str,opt_isHtml); return this. [[#variable62e1cd80]](dir,str,opt_isHtml,opt_dirReset); } ; |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#62e1d860]] | unicodeWrap |
1 | 2 | [[#62e1d860]] | spanWrap |
2 | 1 | [[#62e1cd80]] | unicodeWrapWithKnownDir |
2 | 2 | [[#62e1cd80]] | spanWrapWithKnownDir |