Questions tagged [punctuation]

Punctuation's are the marks, such as full stop, comma, and brackets, used in writing to separate sentences and their elements and to clarify meaning.

451 questions
7
votes
2 answers

What punctuation characters are necessary for a city field?

I'm considering a regex to restrict punctuation in city names (worldwide). What would be a fairly inclusive whitelist of these? I'm thinking: (space) . period - hyphen ' apostrophe Also thinking maybe comma or slash but I don't have any examples.…
User
  • 62,498
  • 72
  • 186
  • 247
7
votes
3 answers

Regex for matching duplicate consecutive punctuation characters with the exception of 3 periods

I have regex (\p{P})\1 which successfully matches duplicate consecutive punctuation characters like ;; ,, \\ , but i need to exclude 3 period (ellipsis) punctuation. ...
Artūras
  • 473
  • 4
  • 13
7
votes
4 answers

VB.NET Brackets () {} [] <>

Can someone please fill in the blanks for me, including a brief description of use and perhaps a code snippet? I'm well aware of the top two in particular, but a little hazy on the last one especially: () - Used for calling a function, object…
Chiramisu
  • 4,687
  • 7
  • 47
  • 77
6
votes
2 answers

runOnUiThread(new Runnable() { punctuation (token) issue

Somehow it doesn't work, according to me it should be this: public void Splash(){ Timer timer= new Timer(); timer.schedule(new TimerTask(){ MexGame.this.runOnUiThread(new Runnable() { public void run(){ …
Diego
  • 4,011
  • 10
  • 50
  • 76
6
votes
1 answer

How to preserve punctuation marks in Scikit-Learn text CountVectorizer or TfidfVectorizer?

Is there any way for me to preserve punctuation marks of !, ?, " and ' from my text documents using text CountVectorizer or TfidfVectorizer parameters in scikit-learn?
6
votes
2 answers

clean line of punctuation and split into words python

learning python currently and having a bit of a problem. I'm trying to take a line from another subprogram and convert it into separate words that have been stripped of their punctuation besides a few. the output of this program is supposed to be…
5
votes
2 answers

Why are leading-hyphen options permitted on `use` lines without fat comma and with strict?

Why is the following use line legal Perl syntax? (Adapted from the POD for parent; tested on Perl 5.26.2 x64 on Cygwin.) package MyHash; use strict; use Tie::Hash; use parent -norequire, "Tie::StdHash"; # ^^^^^^^^^^ A bareword with nothing…
cxw
  • 16,685
  • 2
  • 45
  • 81
5
votes
1 answer

Pyspark how to remove punctuation marks and make lowercase letters in Rdd?

I would like to remove punctuation mark and make the lowercase letters in RDD? Below is my data set l=sc.parallelize(["How are you","Hello\ then% you"\ ,"I think he's fine+ COMING"]) I tried below function but I got an error…
melik
  • 1,268
  • 3
  • 21
  • 42
5
votes
1 answer

Matching last and first bracket in gsub/r and leaving the remaining content intact

I'm working with a character vector of the following format: [-0.2122,-0.1213) [-0.2750,-0.2122) [-0.1213,-0.0222) [-0.1213,-0.0222) I would like to remove [ and ) so I can get the desired result…
Konrad
  • 17,740
  • 16
  • 106
  • 167
5
votes
3 answers

Solr: strip punctuation before index

I am having a problem with striping punctuation from the solr index When the punctuation sign follow right after a word then this word is not indexed properly. For example: if we index "hello, John", the asset won't be found by keyword "hello" while…
Bogdan Gusiev
  • 8,027
  • 16
  • 61
  • 81
5
votes
2 answers

tm custom removePunctuation except hashtag

I have a Corpus of tweets from twitter. I clean this corpus (removeWords, tolower, delete URls) and finally also want to remove punctuation. Here is my code: tweetCorpus <- tm_map(tweetCorpus, removePunctuation, preserve_intra_word_dashes =…
feder80
  • 1,195
  • 3
  • 13
  • 34
5
votes
1 answer

Scala mkString except the last one

I would like to do the following in scala: val l = List("An apple", "a pear", "a grapefruit", "some bread") ... some one-line simple function ... "An apple, a pear, a grapefruit and some bread" What would be the shortest way to write it that…
Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101
4
votes
3 answers

Javascript regex validate password string (escaping punctuations)

I am trying to validate a password string with javascript and need some help with a regex. I have tried some tutorials, but I think I have some problems understanding how to escape quantifiers and/or metacharacters. I want to make sure that the…
José
  • 391
  • 3
  • 14
4
votes
2 answers

Is there a search engine that searches for the exact words you enter, exactly how you entered them?

Is there a search engine that has some of the following features? Case sensitive: "LaTeX" != "latex" Doesn't mess with punctuation in a quoted phrase: "Yes!!!" != "Yes?" Doesn't search for words that have the same stem: "fracture" != "fractured"
Kim Stebel
  • 41,826
  • 12
  • 125
  • 142
4
votes
2 answers

How to remove punctuation excluding negations?

Let's assume I have the following sentence: s = c("I don't want to remove punctuation for negations. Instead, I want to remove only general punctuation. For example, keep I wouldn't like it but remove Inter's fan or Man city's fan.") I would like…
Rollo99
  • 1,601
  • 7
  • 15
1 2
3
30 31