hyphen

Java case insensitive localized ordering

夙愿已清 提交于 2019-12-22 11:09:54
问题 I have set of hyphenated string sets. That I want to sort considering the locale. List<String> words = Arrays.asList("App - Small", "Apple", "App - Big"); Collator collator = Collator.getInstance(new Locale("en")); // Sort Method 1 Collections.sort(words, String.CASE_INSENSITIVE_ORDER); System.out.println(words.toString()); // Sort Method 2 collator.setStrength(Collator.PRIMARY); Collections.sort(words, collator); System.out.println(words.toString()); Result String.CASE_INSENSITIVE_ORDER [App

Java case insensitive localized ordering

 ̄綄美尐妖づ 提交于 2019-12-22 11:07:11
问题 I have set of hyphenated string sets. That I want to sort considering the locale. List<String> words = Arrays.asList("App - Small", "Apple", "App - Big"); Collator collator = Collator.getInstance(new Locale("en")); // Sort Method 1 Collections.sort(words, String.CASE_INSENSITIVE_ORDER); System.out.println(words.toString()); // Sort Method 2 collator.setStrength(Collator.PRIMARY); Collections.sort(words, collator); System.out.println(words.toString()); Result String.CASE_INSENSITIVE_ORDER [App

How to allow fulltext searching with hyphens in the search query

╄→гoц情女王★ 提交于 2019-12-18 04:03:13
问题 I have keywords like "some-or-other" where the hyphens matter in the search through my mysql database. I'm currently using the fulltext function. Is there a way to escape the hyphen character? I know that one option is to comment out #define HYPHEN_IS_DELIM in the myisam/ftdefs.h file, but unfortunately my host does not allow this. Is there another option out there? Edit 3-8-11 Here's the code I have right now: $search_input = $_GET['search_input']; $keyword_safe = mysql_real_escape_string(

ElasticSearch - Searching with hyphens

感情迁移 提交于 2019-12-17 20:35:53
问题 Elastic Search 1.6 I want to index text that contains hyphens, for example U-12, U-17, WU-12, t-shirt... and to be able to use a "Simple Query String" query to search on them. Data sample (simplified): {"title":"U-12 Soccer", "comment": "the t-shirts are dirty"} As there are quite a lot of questions already about hyphens, I tried the following solution already: Use a Char filter: ElasticSearch - Searching with hyphens in name. So I went for this mapping: { "settings":{ "analysis":{ "char

Option not recognized

梦想的初衷 提交于 2019-12-17 17:12:10
问题 I'm trying to use a case statement to determine if I have a legal command. It looks something like this: function commandTest { case $1 in –score) echo "something";; *) echo "unknown";; esac } Now if I use the function like this, it doesn't work. case doesn't recognize the string correctly although it is identical. $ commandTest "-score" unknown What am I doing wrong here? 回答1: As posted, your sample code has an en-dash (Unicode U+2013) in front of score , instead of a minus sign (ASCII 0x2D)

add hyphens on word break in a UILabel

做~自己de王妃 提交于 2019-12-17 15:44:31
问题 How do I set a UILabel lineBreakMode to break words and add hyphens to broken words? a label with a broken wo- rd should look like this 回答1: Elaborating on Matt's answer here: https://stackoverflow.com/a/16502598/196358 it can be done using NSAttributedString and NSParagraphStyle. See below: NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.hyphenationFactor = 1.0f; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]

Dash on the end of javascript object property [duplicate]

只愿长相守 提交于 2019-12-13 22:53:58
问题 This question already has answers here : Unable to access JSON property with “-” dash (3 answers) Closed 5 years ago . can i use dash on the end of javascript object property name like this. I could not find in any documentation that this is not valid but i got some strange results when trying to access value myProp- in this case. var myObject = {"myProp-":"myValue"}; i can only access to this value like this myObject["myProp-"] and i would like to access like myObject.myProp- but i got "

Hypens in domain name of .htaccess rewrite

女生的网名这么多〃 提交于 2019-12-13 07:14:06
问题 the following doesn't work in my .htaccess file... Does it have something to do with the hyphen in the domain name? RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?.*.domain-name.com$ [NC] RewriteCond %{REQUEST_URI} !^/Accounts/2/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /Accounts/2/$1 [L] RewriteCond %{HTTP_HOST} ^(www.)?.*.domain-name.com$ [NC] RewriteRule ^(/)?$ Accounts/2/ [L] any ideas? 来源: https://stackoverflow.com/questions/9982476

how does ruby webdriver get element with hyphen in <name, value> pair

梦想与她 提交于 2019-12-13 03:06:13
问题 I have html like below and I want to get the element by "sku-code"(there is a hyphen in it) <div class="leavemessagebox" style="position: relative;" sku-code="m_showcase"> when I used browser.div(:sku-code=>'m_showcase') ruby reported an error ERROR:undefined local variable or method `code' for #<AUT::WebClient:0x2c59650> It sames ruby can't recognize "sku-code" as a name, anyone can give me any suggestion about how to get the element by "sku-code"? thanks. Sorry for not explain myself

How to hyphenate text?

只谈情不闲聊 提交于 2019-12-12 12:24:30
问题 I generate an PDF file with iText in Java. My table columns have fixed widths and text, which is too long for one line is wrapped in the cell. But hyphenation is not used. The word "Leistungsscheinziffer" is shown as: Leistungssc //Break here heinziffer My code where I use hyphenation: final PdfPTable table = new PdfPTable(sumCols); table.getDefaultCell().setBorder(Rectangle.NO_BORDER); table.getDefaultCell().setPadding(4f); table.setWidths(widthsCols); table.setWidthPercentage(100); table