Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5038412d
Kaydet (Commit)
5038412d
authored
May 23, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added __doc__ strings. Added get_soundex().
üst
bceeac8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
2 deletions
+36
-2
soundex.c
Modules/soundex.c
+36
-2
No files found.
Modules/soundex.c
Dosyayı görüntüle @
5038412d
...
@@ -8,12 +8,19 @@
...
@@ -8,12 +8,19 @@
for non-literal string matching.
for non-literal string matching.
From: David Wayne Williams <dwwillia@iucf.indiana.edu>
From: David Wayne Williams <dwwillia@iucf.indiana.edu>
Apr 29 1996 - added get_soundex method that returns the soundex of a
string (chrish@qnx.com)
May 2 1996 - added doc strings (chrish@qnx.com)
*/
*/
#include <string.h>
#include <string.h>
#include <ctype.h>
#include <ctype.h>
#include "Python.h"
#include "Python.h"
static
char
soundex_module__doc__
[]
=
"Perform Soundex comparisons on strings, allowing non-literal matching."
;
void
soundex_hash
(
char
*
str
,
char
*
result
)
void
soundex_hash
(
char
*
str
,
char
*
result
)
{
{
char
*
sptr
=
str
;
/* pointer into str */
char
*
sptr
=
str
;
/* pointer into str */
...
@@ -104,6 +111,27 @@ void soundex_hash(char *str, char *result)
...
@@ -104,6 +111,27 @@ void soundex_hash(char *str, char *result)
}
}
/* Return the actual soundex value. */
/* Added by Chris Herborth (chrish@qnx.com) */
static
char
soundex_get_soundex__doc__
[]
=
"Return the (English) Soundex hash value for a string."
;
static
PyObject
*
get_soundex
(
PyObject
*
self
,
PyObject
*
args
)
{
char
*
str
;
int
retval
;
char
sdx
[
7
];
if
(
!
PyArg_ParseTuple
(
args
,
"s"
,
&
str
))
return
NULL
;
soundex_hash
(
str
,
sdx
);
return
PyString_FromString
(
sdx
);
}
static
char
soundex_sound_similar__doc__
[]
=
"Compare two strings to see if they sound similar (English)."
;
static
PyObject
*
static
PyObject
*
sound_similar
(
PyObject
*
self
,
PyObject
*
args
)
sound_similar
(
PyObject
*
self
,
PyObject
*
args
)
{
{
...
@@ -127,7 +155,9 @@ sound_similar(PyObject *self, PyObject *args)
...
@@ -127,7 +155,9 @@ sound_similar(PyObject *self, PyObject *args)
*/
*/
static
PyMethodDef
SoundexMethods
[]
=
static
PyMethodDef
SoundexMethods
[]
=
{
{
{
"sound_similar"
,
sound_similar
,
1
},
{
"sound_similar"
,
sound_similar
,
1
,
soundex_sound_similar__doc__
},
{
"get_soundex"
,
get_soundex
,
1
,
soundex_get_soundex__doc__
},
{
NULL
,
NULL
}
/* sentinel */
{
NULL
,
NULL
}
/* sentinel */
};
};
...
@@ -137,5 +167,9 @@ static PyMethodDef SoundexMethods[] =
...
@@ -137,5 +167,9 @@ static PyMethodDef SoundexMethods[] =
void
void
initsoundex
()
initsoundex
()
{
{
(
void
)
Py_InitModule
(
"soundex"
,
SoundexMethods
);
(
void
)
Py_InitModule4
(
"soundex"
,
SoundexMethods
,
soundex_module__doc__
,
(
PyObject
*
)
NULL
,
PYTHON_API_VERSION
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment