0% found this document useful (0 votes)
67 views7 pages

Mini Pro

The document discusses commasprinkler, a tool that automatically applies rules for proper comma placement in English sentences. It describes Dr. Comma Sprinkler's rules for adding commas to existing text, such as putting a comma before repeated words preceded by a comma elsewhere in the text.

Uploaded by

Shashvath Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views7 pages

Mini Pro

The document discusses commasprinkler, a tool that automatically applies rules for proper comma placement in English sentences. It describes Dr. Comma Sprinkler's rules for adding commas to existing text, such as putting a comma before repeated words preceded by a comma elsewhere in the text.

Uploaded by

Shashvath Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sou.

Sushi
l
aDanchandGhodawatChar
it
abl
eTr
ust
’s
Sanj
ayGhodawatUni
ver
sit
y,Kol
hapur

Sy
nopsi
son

COMMASPRI
NKLER

by

Mr
.Har
shv
ardhanPat
il
Mr
.Ki
ranYal
i
gar
Mr
.Vi
gneshShet
ty

Undert
hegui
danceof

Pr
of.S.S.Mor
e

Depar
tmentofComput
erSci
ence&Engi
neer
ing
2018-
2019
I
ntr
oduct
ion
Engl
i
shi
sthemostpopul
arl
anguagewhi
chi
susedar
oundt
hewor
ld.Asweknow
t
hat
,ther
ear
esomer
ulesandcondi
ti
onwhi
char
efol
l
owedwhi
l
efr
ami
ngany
sent
ences.I
fyoudon’
tknowandy
ouar
efr
eshert
othel
anguaget
heny
oust
artwi
th
basi
cs,
i.
efr
om t
hebaseGRAMMER.
Lear
ninggr
ammerofanyl
anguagei
sbasi
cst
epwhi
chat
eacherorl
ear
nerpr
efer
s
f
ir
st.I
nGr
ammert
her
ear
e‘N’
no.
rul
esandst
epsar
efol
l
owedwhi
l
elear
ningEngl
i
sh.
Atf
ir
stst
ep,l
ear
nerst
art
swi
thal
phabet
s,t
heusi
ngt
hoseal
phabet
slear
nerf
orms
obj
ect
,fur
therSent
ences,
nextaPar
agr
aphandsoon.
Butknowi
ngonl
yal
phabet
sisi
nsuf
fi
entt
askt
ofr
ameanysent
ence.Sof
ort
his
someoper
ator
sli
kecomma,
semi
-col
l
en,
col
l
een,
inv
ert
edcommaar
eused.
I
nthi
spr
ojectwedi
scussaboutanoper
atorcal
l
edascomma,andsot
her
efor
ethe
nameofourpr
ojecti
scal
l
edasCOMMASPRI
NKLER.

Pr
obl
em St
atement
Aspr
act
icewi
l
ltel
lyou,t
heEngl
i
sh r
ulesf
orcommapl
acementar
ecompl
ex,
f
rust
rat
ing,andof
tenambi
guous.Manypeopl
e,ev
ent
heEngl
i
sh,wi
l
l,i
npr
act
ice,
i
gnor
ethem,
and,
appl
ycust
om r
ules,
or,
nor
ules,
atal
l
.
Doct
orCommaSpr
inkl
ersol
vedt
hisi
ssuebydev
elopi
ngasetofr
ulest
hatspr
inkl
es
commasi
nasent
encewi
thnoambi
gui
tyandl
i
ttl
esi
mpl
i
cit
y.I
nthi
spr
obl
em y
ouwi
l
l
hel
pDr
.Spr
inkl
erbypr
oduci
nganal
gor
it
hm t
oaut
omat
ical
l
yappl
yherr
ules.

Dr
.Spr
inkl
er’
srul
esf
oraddi
ngcommast
oanexi
sti
ngpi
eceoft
extar
easf
oll
ows:

1.I
fawor
dany
wher
eint
het
exti
spr
ecededbyacomma,
findal
loccur
rencesoft
hat
wor
dint
het
ext
,andputacommabef
oreeachoft
hoseoccur
rences,excepti
nthe
casewher
esuchanoccur
rencei
sthef
ir
stwor
dofasent
enceoral
readypr
eceded
byacomma.
2.I
fawor
dany
wher
eint
het
exti
ssucceededbyacomma,f
indal
loccur
rencesof
t
hatwor
dint
het
ext
,andputacommaaf
tereachoft
hoseoccur
rences,
excepti
nthe
casewher
esuchanoccur
rencei
sthel
astwor
dofasent
enceoral
readysucceeded
byacomma.

3.Appl
yrul
es1and2r
epeat
edl
yunt
ilnonewcommascanbeaddedusi
ngei
therof
t
hem.

Exampl
e:
I
nput
:pl
easesi
tspot
.si
tspot
,si
t.spother
enowher
e.
Out
put
:pl
ease,
sitspot
.si
tspot
,si
t.spot
,her
enow,
her
e.

Sol
uti
ont
opr
obl
em st
atement
Thesol
uti
on f
ort
hegi
ven pr
obl
em st
atementcan best
ri
ng mani
pul
ati
on.The
t
ext
(par
agr
aph)shoul
dbet
akenasi
nputasaSt
ri
ng.Thest
ri
ngi
ssentt
oar
ecur
siv
e
f
unct
ionf
orf
urt
herwor
k.Or
igi
nalst
ri
ngi
sst
oredasi
tis(
asr
ecur
sionst
ri
ng)
.The
st
ri
ngshoul
dbespl
i
tint
osmal
l
ersubpar
tsf
rom t
hepoi
ntofappear
anceofaf
ull
st
op.Thei
ndexofcommai
stakenandst
oredt
empor
ari
l
y.Thewor
dbef
oreand
af
tert
hecommai
sst
oredt
empor
ari
l
ytwodi
mensi
onalar
ray
.Thewor
dbef
ore
commai
nonedi
mensi
onandt
hewor
daf
tercommai
nanot
herdi
mensi
on.Thewor
d
i
nthet
ext(
str
ing/
par
agr
aph)i
srepl
acedwi
thwor
dpl
uscommai
nfr
onti
fwor
dis
onedi
mensi
onandwi
thwor
dpl
uscommai
natbegi
nni
ngi
fwor
disi
nanot
her
di
mensi
on.

Atl
astachecki
sper
for
medt
oremov
ecommaf
oll
owi
ng commaoraf
ullst
op.The
st
ri
ngi
sthencompar
edt
opr
evi
ousr
ecur
sionst
ri
ng,i
fbot
har
eequalwest
opand
pr
intt
hemani
pul
atedst
ri
ngasout
put
,ifi
tdoesnotmat
chwesendst
ri
ngbackf
or
mani
pul
ati
onusi
ngr
ecur
sion.

I
nputandExpect
edOut
put
I
nput
Thei
nputcont
ainsonel
i
neoft
ext
,cont
aini
ngatl
east2char
act
ersandatmost
1,
000,
000char
act
ers.Eachchar
act
eri
sei
theral
ower
casel
ett
er,
acomma,
aper
iod,
oraspace.Wedef
ineawor
dtobeamaxi
malsequenceofl
ett
erswi
thi
nthet
ext
.
Thet
extadher
est
othef
oll
owi
ngconst
rai
nts:
•Thet
extbegi
nswi
thawor
d.
•Bet
weenev
eryt
wowor
dsi
nthet
ext
,ther
eisei
therasi
ngl
espace,acomma
f
oll
owedbyaspace,
oraper
iodf
oll
owedbyaspace(
denot
ingt
heendofasent
ence
andt
hebegi
nni
ngofanewone)
.
•Thel
astwor
doft
het
exti
sfol
l
owedbyaper
iodwi
thnot
rai
l
ingspace.

Out
put
Di
spl
ayther
esul
taf
terappl
yi
ngDr
.Spr
inkl
er’
sal
gor
it
hm t
otheor
igi
nal
text
.
SampleI
nput1
pl
easesi
tspot
.si
tspot
,si
t.spother
enowher
e.
SampleOutput1
pl
ease,si
tspot.si
tspot
,si
t.spot
,her
enow,
her
e.

Har
dwar
eRequi
rement
s
 Pant
ium 4,
266MHzpr
ocessor
 Di
skspace:
124MBf
orJRE;
2MBf
orJav
aupdat
e

Sof
twar
eRequi
rement
s

 Jav
a7
Fl
owChar
t

St
art

Decl
arev
ari
abl
etext

Readt
ext

Sender

End
st
ar

I
nputst
ri
ngt
ext

B sender

Whil
etext A
has“,

Geti
ndexof”
,”

I
findex
of“,
”>=0

While
charat

Appendchart
oB

Whil
echar
atf
ront!
=”

Appendchart
o
Rfront++

Remov
e“,
”f
rom t
ext

St
oreBandRi
nar
ray
A

For(
i=0;
i
<array
_lenght
[]
;
i++)
.Replace

Repl
ace“,
,
”wi
th“
,”
“.
,
”wi
th“.

“.
,
”wi
th“.

Ifor
igi
nal NO
text
B
equals
text

YES

Di
spl
ayt
ext

END
Ref
erences
Websi
tes:
-
www.
quor
a.com
www.
geeksf
orgeeks.
org
Books
Jav
a:Thecompl
eteRef
erence
LetUsJav
a

Prof
.S.S.More Dr
.B.
C.Meli
namat
h
Proj
ectGuide HODCSE

You might also like