Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Fixed bug in editdistance. | a786775b057fc5795db1b2b106b7b9e3c1df6c4c | lep | 2015-02-02 13:41:15 |
Added basic uninitialized variable check for locals. | c8222a6f68e44a46624c1f9ee781f590522f45f6 | lep | 2015-02-02 12:41:25 |
Added git-versionstring. | e13ce6d7d90bccd8e18de6d0b01a18ea4501862b | lep | 2015-02-01 14:56:01 |
Removed returnsbool-check for Filter/Condition. | e26a973fe1fdc1af999633c8d1f29afcbae76f0b | lep | 2015-02-01 14:51:47 |
Fixed some bison warnings. | aca6b13e73d95c41787a7a0fdcc33407247be3a8 | lep | 2015-02-01 14:49:55 |
Removed multiline comments. | e6d3a1bb5099bbf6e3a4ef2501645b15908a1ce8 | lep | 2015-02-01 14:49:16 |
Removed unnecessary tokens. | 4f37057dfd472c2a400d667a6f7a3762cac01dcd | lep | 2015-02-01 14:48:14 |
Comments now work with EOF in addition to newlines at the end. | 5363d3ca429da30594f7afb9d351335912b03fbd | lep | 2015-02-01 14:46:09 |
pjass 10n | 2b2d35bc58dc93bc68014711cda919cecff13b4a | lep | 2014-10-25 20:38:00 |
pjass 10m | 265bac6343dfeb09e1fc0af5c06571c7dc172455 | Deaod | 2010-02-15 12:15:00 |
pjass 10l | 0c9161120896904b55b3cdd7b2f7430dd97f82e9 | PitzerMike | 2009-06-15 21:30:00 |
pjass 10k | 43c1a8a167cdf2982af2c47056beeafcd1840537 | Zoxc | 2009-04-03 21:23:00 |
pjass 10j | 16bbe625b7670a7affcf495e3370224c30582bca | PitzerMike | 2007-10-09 09:22:00 |
pjass 10i | 1ecf3d1238619358a0aa9b1b919ed9ba97d36f84 | PitzerMike | 2007-09-29 11:57:00 |
pjass 10h | dcb319607e8bb35637f86918962610683ada2b08 | PitzerMike | 2007-09-13 23:49:00 |
pjass 10g | a5070a4d74abc627160481e592233fa26870d57a | PitzerMike | 2007-08-24 10:43:00 |
pjass 10f | e6893a0480e2b1c9bb22f39a897a86e8d05123a6 | PitzerMike | 2007-04-28 08:26:00 |
Fake commit to cleanup the cvs-import of the pjass sourceforge repo. | 7f2ea341ebf2ed939f99ec3b14403025446e25f5 | lep | 2017-01-11 14:07:30 |
Fixed some errors on Debian and removed some warnings. | 28b8a48ff580cb1c06343b4f51194b9a18f0901c | cilibrar | 2004-08-15 07:15:22 |
Works under Linux, removed debug messages. | 60be798cd6b6e8ad3432feecf3418c7d2662807f | cilibrar | 2004-08-15 07:10:44 |
File | Lines added | Lines deleted |
---|---|---|
misc.c | 2 | 2 |
File misc.c changed (mode: 100644) (index 0319c74..0a8e665) | |||
... | ... | int editdistance(const char *s, const char *t){ | |
101 | 101 | for(i = 0; i != 3; i++) | for(i = 0; i != 3; i++) |
102 | 102 | v[i] = malloc(sizeof(int) * (b+1)); | v[i] = malloc(sizeof(int) * (b+1)); |
103 | 103 | ||
104 | for(i = 0; i != b; i++){ | ||
104 | for(i = 0; i != b+1; i++){ | ||
105 | 105 | v[0][i] = i; | v[0][i] = i; |
106 | 106 | } | } |
107 | 107 | ||
... | ... | int editdistance(const char *s, const char *t){ | |
119 | 119 | for(j = 0; j != b; j++){ | for(j = 0; j != b; j++){ |
120 | 120 | int cost = (s[i] == t[j]) ? 0 : 1; | int cost = (s[i] == t[j]) ? 0 : 1; |
121 | 121 | v[cur][j+1] = min(v[cur][j] + 1, min(v[pcur][j+1] + 1, v[pcur][j] + cost)); | v[cur][j+1] = min(v[cur][j] + 1, min(v[pcur][j+1] + 1, v[pcur][j] + cost)); |
122 | |||
122 | |||
123 | 123 | if(i > 0 && j > 0 && s[i] == t[j-1] && s[i-1] == t[j]){ | if(i > 0 && j > 0 && s[i] == t[j-1] && s[i-1] == t[j]){ |
124 | 124 | v[cur][j+1] = min(v[cur][j+1], v[ppcur][j-1] + cost); | v[cur][j+1] = min(v[cur][j+1], v[ppcur][j-1] + cost); |
125 | 125 | } | } |