├── .gitignore ├── .gitmodules ├── BayesianKit.xcodeproj └── project.pbxproj ├── BayesianKit_Prefix.pch ├── DocSet-Info.plist ├── Doxyfile ├── English.lproj └── InfoPlist.strings ├── Info.plist ├── LICENSE ├── README.markdown ├── docs └── man │ └── man1 │ └── bayes.1 ├── src ├── BKClassifier.h ├── BKClassifier.m ├── BKDataPool.h ├── BKDataPool.m ├── BKTokenData.h ├── BKTokenData.m ├── BKTokenizer.h ├── BKTokenizer.m ├── BKTokenizing.h └── BayesianKit.h └── tools ├── Bayes.h ├── Bayes.m ├── Utils.h ├── Utils.m └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | profile 3 | 4 | build/* 5 | *.pbxuser 6 | *.mode1v3 7 | 8 | docs/ 9 | !docs/man/man1/bayes.1 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/ParseKit"] 2 | path = external/ParseKit 3 | url = git://github.com/itod/parsekit.git 4 | [submodule "external/appledoc"] 5 | path = external/appledoc 6 | url = git://github.com/tomaz/appledoc.git 7 | -------------------------------------------------------------------------------- /BayesianKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 45; 7 | objects = { 8 | 9 | /* Begin PBXAggregateTarget section */ 10 | E277E6A711753345009BCC70 /* Install Documentation */ = { 11 | isa = PBXAggregateTarget; 12 | buildConfigurationList = E277E6AA11753363009BCC70 /* Build configuration list for PBXAggregateTarget "Install Documentation" */; 13 | buildPhases = ( 14 | E277E6A611753345009BCC70 /* ShellScript */, 15 | ); 16 | comments = "Generate and install Xcode documentation for BayesianKit."; 17 | dependencies = ( 18 | E2259A151176998800353F51 /* PBXTargetDependency */, 19 | ); 20 | name = "Install Documentation"; 21 | productName = Documentation; 22 | }; 23 | /* End PBXAggregateTarget section */ 24 | 25 | /* Begin PBXBuildFile section */ 26 | 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 27 | E22599F31176971300353F51 /* ParseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E22599E0117696E400353F51 /* ParseKit.framework */; }; 28 | E26C13AB115D863500CFCCF1 /* BayesianKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* BayesianKit.framework */; }; 29 | E26C145D115E324100CFCCF1 /* BayesianKit.h in Headers */ = {isa = PBXBuildFile; fileRef = E26C1453115E324100CFCCF1 /* BayesianKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 30 | E26C145E115E324100CFCCF1 /* BKClassifier.h in Headers */ = {isa = PBXBuildFile; fileRef = E26C1454115E324100CFCCF1 /* BKClassifier.h */; settings = {ATTRIBUTES = (Public, ); }; }; 31 | E26C145F115E324100CFCCF1 /* BKClassifier.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C1455115E324100CFCCF1 /* BKClassifier.m */; }; 32 | E26C1460115E324100CFCCF1 /* BKDataPool.h in Headers */ = {isa = PBXBuildFile; fileRef = E26C1456115E324100CFCCF1 /* BKDataPool.h */; settings = {ATTRIBUTES = (Public, ); }; }; 33 | E26C1461115E324100CFCCF1 /* BKDataPool.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C1457115E324100CFCCF1 /* BKDataPool.m */; }; 34 | E26C1462115E324100CFCCF1 /* BKTokenData.h in Headers */ = {isa = PBXBuildFile; fileRef = E26C1458115E324100CFCCF1 /* BKTokenData.h */; settings = {ATTRIBUTES = (Public, ); }; }; 35 | E26C1463115E324100CFCCF1 /* BKTokenData.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C1459115E324100CFCCF1 /* BKTokenData.m */; }; 36 | E26C1464115E324100CFCCF1 /* BKTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = E26C145A115E324100CFCCF1 /* BKTokenizer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 37 | E26C1465115E324100CFCCF1 /* BKTokenizer.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C145B115E324100CFCCF1 /* BKTokenizer.m */; }; 38 | E26C1466115E324100CFCCF1 /* BKTokenizing.h in Headers */ = {isa = PBXBuildFile; fileRef = E26C145C115E324100CFCCF1 /* BKTokenizing.h */; settings = {ATTRIBUTES = (Public, ); }; }; 39 | E26C1475115E329F00CFCCF1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C1474115E329F00CFCCF1 /* main.m */; }; 40 | E26C14D3115E822100CFCCF1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; }; 41 | E26C14E2115E838F00CFCCF1 /* Bayes.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C14E1115E838F00CFCCF1 /* Bayes.m */; }; 42 | E26C153E115E8E8A00CFCCF1 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = E26C153D115E8E8A00CFCCF1 /* Utils.m */; }; 43 | /* End PBXBuildFile section */ 44 | 45 | /* Begin PBXContainerItemProxy section */ 46 | E22599DF117696E400353F51 /* PBXContainerItemProxy */ = { 47 | isa = PBXContainerItemProxy; 48 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 49 | proxyType = 2; 50 | remoteGlobalIDString = 8DC2EF5B0486A6940098B216; 51 | remoteInfo = ParseKit; 52 | }; 53 | E22599E1117696E400353F51 /* PBXContainerItemProxy */ = { 54 | isa = PBXContainerItemProxy; 55 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 56 | proxyType = 2; 57 | remoteGlobalIDString = D389F1CE0F1965E600558235; 58 | remoteInfo = JSParseKit; 59 | }; 60 | E22599E3117696E400353F51 /* PBXContainerItemProxy */ = { 61 | isa = PBXContainerItemProxy; 62 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 63 | proxyType = 2; 64 | remoteGlobalIDString = D3FDC5830FFC4BFC00F1F797; 65 | remoteInfo = ParseKitMobile; 66 | }; 67 | E22599E5117696E400353F51 /* PBXContainerItemProxy */ = { 68 | isa = PBXContainerItemProxy; 69 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 70 | proxyType = 2; 71 | remoteGlobalIDString = D3C7D87A0A411FBF005DD154; 72 | remoteInfo = Tests; 73 | }; 74 | E22599E7117696E400353F51 /* PBXContainerItemProxy */ = { 75 | isa = PBXContainerItemProxy; 76 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 77 | proxyType = 2; 78 | remoteGlobalIDString = D33494100E2963FD00406085; 79 | remoteInfo = DemoApp; 80 | }; 81 | E22599E9117696E400353F51 /* PBXContainerItemProxy */ = { 82 | isa = PBXContainerItemProxy; 83 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 84 | proxyType = 2; 85 | remoteGlobalIDString = D34185040E520D3F0081B0DC; 86 | remoteInfo = DebugApp; 87 | }; 88 | E22599EB117696E400353F51 /* PBXContainerItemProxy */ = { 89 | isa = PBXContainerItemProxy; 90 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 91 | proxyType = 2; 92 | remoteGlobalIDString = D389F2030F196A7500558235; 93 | remoteInfo = JSDemoApp; 94 | }; 95 | E22599F11176970A00353F51 /* PBXContainerItemProxy */ = { 96 | isa = PBXContainerItemProxy; 97 | containerPortal = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 98 | proxyType = 1; 99 | remoteGlobalIDString = 8DC2EF4F0486A6940098B216; 100 | remoteInfo = ParseKit; 101 | }; 102 | E2259A121176997E00353F51 /* PBXContainerItemProxy */ = { 103 | isa = PBXContainerItemProxy; 104 | containerPortal = E2259A081176997E00353F51 /* appledoc.xcodeproj */; 105 | proxyType = 2; 106 | remoteGlobalIDString = 8DD76FA10486AA7600D96B5E; 107 | remoteInfo = appledoc; 108 | }; 109 | E2259A141176998800353F51 /* PBXContainerItemProxy */ = { 110 | isa = PBXContainerItemProxy; 111 | containerPortal = E2259A081176997E00353F51 /* appledoc.xcodeproj */; 112 | proxyType = 1; 113 | remoteGlobalIDString = 8DD76F960486AA7600D96B5E; 114 | remoteInfo = appledoc; 115 | }; 116 | E2A323DF115CF01200E4D006 /* PBXContainerItemProxy */ = { 117 | isa = PBXContainerItemProxy; 118 | containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; 119 | proxyType = 1; 120 | remoteGlobalIDString = 8DC2EF4F0486A6940098B216; 121 | remoteInfo = Bayesian; 122 | }; 123 | /* End PBXContainerItemProxy section */ 124 | 125 | /* Begin PBXFileReference section */ 126 | 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 127 | 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 128 | 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 129 | 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 130 | 32DBCF5E0370ADEE00C91783 /* BayesianKit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BayesianKit_Prefix.pch; sourceTree = ""; }; 131 | 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 132 | 8DC2EF5B0486A6940098B216 /* BayesianKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = BayesianKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 133 | D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 134 | E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ParseKit.xcodeproj; path = external/ParseKit/ParseKit.xcodeproj; sourceTree = ""; }; 135 | E22599AC117681F200353F51 /* bayes.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; name = bayes.1; path = docs/man/man1/bayes.1; sourceTree = ""; }; 136 | E2259A081176997E00353F51 /* appledoc.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = appledoc.xcodeproj; path = external/appledoc/appledoc.xcodeproj; sourceTree = ""; }; 137 | E26C1453115E324100CFCCF1 /* BayesianKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BayesianKit.h; sourceTree = ""; }; 138 | E26C1454115E324100CFCCF1 /* BKClassifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKClassifier.h; sourceTree = ""; wrapsLines = 0; }; 139 | E26C1455115E324100CFCCF1 /* BKClassifier.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKClassifier.m; sourceTree = ""; }; 140 | E26C1456115E324100CFCCF1 /* BKDataPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKDataPool.h; sourceTree = ""; }; 141 | E26C1457115E324100CFCCF1 /* BKDataPool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKDataPool.m; sourceTree = ""; }; 142 | E26C1458115E324100CFCCF1 /* BKTokenData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKTokenData.h; sourceTree = ""; }; 143 | E26C1459115E324100CFCCF1 /* BKTokenData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKTokenData.m; sourceTree = ""; }; 144 | E26C145A115E324100CFCCF1 /* BKTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKTokenizer.h; sourceTree = ""; }; 145 | E26C145B115E324100CFCCF1 /* BKTokenizer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKTokenizer.m; sourceTree = ""; }; 146 | E26C145C115E324100CFCCF1 /* BKTokenizing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKTokenizing.h; sourceTree = ""; }; 147 | E26C1474115E329F00CFCCF1 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 148 | E26C14C5115E817B00CFCCF1 /* bayes */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = bayes; sourceTree = BUILT_PRODUCTS_DIR; }; 149 | E26C14E0115E838F00CFCCF1 /* Bayes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bayes.h; sourceTree = ""; }; 150 | E26C14E1115E838F00CFCCF1 /* Bayes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bayes.m; sourceTree = ""; }; 151 | E26C153C115E8E8A00CFCCF1 /* Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Utils.h; sourceTree = ""; }; 152 | E26C153D115E8E8A00CFCCF1 /* Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utils.m; sourceTree = ""; }; 153 | E277E77B1175F606009BCC70 /* DocSet-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "DocSet-Info.plist"; sourceTree = ""; }; 154 | E277E77C1175F606009BCC70 /* Doxyfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Doxyfile; sourceTree = ""; }; 155 | E277E7B31175FD5B009BCC70 /* appledoc */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = appledoc; sourceTree = ""; }; 156 | E277E7B41175FD5B009BCC70 /* Readme.markdown */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Readme.markdown; sourceTree = ""; }; 157 | E277E7B61175FD5B009BCC70 /* object.xslt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = object.xslt; sourceTree = ""; }; 158 | E277E7B71175FD5B009BCC70 /* screen.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = screen.css; sourceTree = ""; }; 159 | /* End PBXFileReference section */ 160 | 161 | /* Begin PBXFrameworksBuildPhase section */ 162 | 8DC2EF560486A6940098B216 /* Frameworks */ = { 163 | isa = PBXFrameworksBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | E22599F31176971300353F51 /* ParseKit.framework in Frameworks */, 167 | E26C14D3115E822100CFCCF1 /* Foundation.framework in Frameworks */, 168 | ); 169 | runOnlyForDeploymentPostprocessing = 0; 170 | }; 171 | E2A323D9115CF00D00E4D006 /* Frameworks */ = { 172 | isa = PBXFrameworksBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | E26C13AB115D863500CFCCF1 /* BayesianKit.framework in Frameworks */, 176 | ); 177 | runOnlyForDeploymentPostprocessing = 0; 178 | }; 179 | /* End PBXFrameworksBuildPhase section */ 180 | 181 | /* Begin PBXGroup section */ 182 | 034768DFFF38A50411DB9C8B /* Products */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 8DC2EF5B0486A6940098B216 /* BayesianKit.framework */, 186 | E26C14C5115E817B00CFCCF1 /* bayes */, 187 | ); 188 | name = Products; 189 | sourceTree = ""; 190 | }; 191 | 0867D691FE84028FC02AAC07 /* Bayesian */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | E2259A081176997E00353F51 /* appledoc.xcodeproj */, 195 | E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */, 196 | E26C1452115E324100CFCCF1 /* Framework */, 197 | E26C1473115E329F00CFCCF1 /* Bayes CLI Tool */, 198 | 32C88DFF0371C24200C91783 /* Other Sources */, 199 | 089C1665FE841158C02AAC07 /* Resources */, 200 | 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 201 | E277E7B11175FD5B009BCC70 /* External */, 202 | 034768DFFF38A50411DB9C8B /* Products */, 203 | ); 204 | name = Bayesian; 205 | sourceTree = ""; 206 | }; 207 | 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, 211 | 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, 212 | ); 213 | name = "External Frameworks and Libraries"; 214 | sourceTree = ""; 215 | }; 216 | 089C1665FE841158C02AAC07 /* Resources */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | E277E77C1175F606009BCC70 /* Doxyfile */, 220 | E277E77B1175F606009BCC70 /* DocSet-Info.plist */, 221 | 8DC2EF5A0486A6940098B216 /* Info.plist */, 222 | 089C1666FE841158C02AAC07 /* InfoPlist.strings */, 223 | E22599AC117681F200353F51 /* bayes.1 */, 224 | ); 225 | name = Resources; 226 | sourceTree = ""; 227 | }; 228 | 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, 232 | ); 233 | name = "Linked Frameworks"; 234 | sourceTree = ""; 235 | }; 236 | 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | 0867D6A5FE840307C02AAC07 /* AppKit.framework */, 240 | D2F7E79907B2D74100F64583 /* CoreData.framework */, 241 | 0867D69BFE84028FC02AAC07 /* Foundation.framework */, 242 | ); 243 | name = "Other Frameworks"; 244 | sourceTree = ""; 245 | }; 246 | 32C88DFF0371C24200C91783 /* Other Sources */ = { 247 | isa = PBXGroup; 248 | children = ( 249 | 32DBCF5E0370ADEE00C91783 /* BayesianKit_Prefix.pch */, 250 | ); 251 | name = "Other Sources"; 252 | sourceTree = ""; 253 | }; 254 | E22599D6117696E400353F51 /* Products */ = { 255 | isa = PBXGroup; 256 | children = ( 257 | E22599E0117696E400353F51 /* ParseKit.framework */, 258 | E22599E2117696E400353F51 /* JSParseKit.framework */, 259 | E22599E4117696E400353F51 /* libparsekit.a */, 260 | E22599E6117696E400353F51 /* Tests.octest */, 261 | E22599E8117696E400353F51 /* DemoApp.app */, 262 | E22599EA117696E400353F51 /* DebugApp.app */, 263 | E22599EC117696E400353F51 /* JSDemoApp.app */, 264 | ); 265 | name = Products; 266 | sourceTree = ""; 267 | }; 268 | E2259A091176997E00353F51 /* Products */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | E2259A131176997E00353F51 /* appledoc */, 272 | ); 273 | name = Products; 274 | sourceTree = ""; 275 | }; 276 | E26C1452115E324100CFCCF1 /* Framework */ = { 277 | isa = PBXGroup; 278 | children = ( 279 | E26C1453115E324100CFCCF1 /* BayesianKit.h */, 280 | E26C1454115E324100CFCCF1 /* BKClassifier.h */, 281 | E26C1455115E324100CFCCF1 /* BKClassifier.m */, 282 | E26C1456115E324100CFCCF1 /* BKDataPool.h */, 283 | E26C1457115E324100CFCCF1 /* BKDataPool.m */, 284 | E26C1458115E324100CFCCF1 /* BKTokenData.h */, 285 | E26C1459115E324100CFCCF1 /* BKTokenData.m */, 286 | E26C145A115E324100CFCCF1 /* BKTokenizer.h */, 287 | E26C145B115E324100CFCCF1 /* BKTokenizer.m */, 288 | E26C145C115E324100CFCCF1 /* BKTokenizing.h */, 289 | ); 290 | name = Framework; 291 | path = src; 292 | sourceTree = ""; 293 | }; 294 | E26C1473115E329F00CFCCF1 /* Bayes CLI Tool */ = { 295 | isa = PBXGroup; 296 | children = ( 297 | E26C1474115E329F00CFCCF1 /* main.m */, 298 | E26C14E0115E838F00CFCCF1 /* Bayes.h */, 299 | E26C14E1115E838F00CFCCF1 /* Bayes.m */, 300 | E26C153C115E8E8A00CFCCF1 /* Utils.h */, 301 | E26C153D115E8E8A00CFCCF1 /* Utils.m */, 302 | ); 303 | name = "Bayes CLI Tool"; 304 | path = tools; 305 | sourceTree = ""; 306 | }; 307 | E277E7B11175FD5B009BCC70 /* External */ = { 308 | isa = PBXGroup; 309 | children = ( 310 | E277E7B21175FD5B009BCC70 /* appledoc */, 311 | ); 312 | name = External; 313 | path = external; 314 | sourceTree = ""; 315 | }; 316 | E277E7B21175FD5B009BCC70 /* appledoc */ = { 317 | isa = PBXGroup; 318 | children = ( 319 | E277E7B31175FD5B009BCC70 /* appledoc */, 320 | E277E7B41175FD5B009BCC70 /* Readme.markdown */, 321 | E277E7B51175FD5B009BCC70 /* Templates */, 322 | ); 323 | path = appledoc; 324 | sourceTree = ""; 325 | }; 326 | E277E7B51175FD5B009BCC70 /* Templates */ = { 327 | isa = PBXGroup; 328 | children = ( 329 | E277E7B61175FD5B009BCC70 /* object.xslt */, 330 | E277E7B71175FD5B009BCC70 /* screen.css */, 331 | ); 332 | path = Templates; 333 | sourceTree = ""; 334 | }; 335 | /* End PBXGroup section */ 336 | 337 | /* Begin PBXHeadersBuildPhase section */ 338 | 8DC2EF500486A6940098B216 /* Headers */ = { 339 | isa = PBXHeadersBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | E26C145D115E324100CFCCF1 /* BayesianKit.h in Headers */, 343 | E26C145E115E324100CFCCF1 /* BKClassifier.h in Headers */, 344 | E26C1460115E324100CFCCF1 /* BKDataPool.h in Headers */, 345 | E26C1462115E324100CFCCF1 /* BKTokenData.h in Headers */, 346 | E26C1464115E324100CFCCF1 /* BKTokenizer.h in Headers */, 347 | E26C1466115E324100CFCCF1 /* BKTokenizing.h in Headers */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXHeadersBuildPhase section */ 352 | 353 | /* Begin PBXNativeTarget section */ 354 | 8DC2EF4F0486A6940098B216 /* BayesianKit */ = { 355 | isa = PBXNativeTarget; 356 | buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "BayesianKit" */; 357 | buildPhases = ( 358 | 8DC2EF500486A6940098B216 /* Headers */, 359 | 8DC2EF520486A6940098B216 /* Resources */, 360 | 8DC2EF540486A6940098B216 /* Sources */, 361 | 8DC2EF560486A6940098B216 /* Frameworks */, 362 | ); 363 | buildRules = ( 364 | ); 365 | dependencies = ( 366 | E22599F21176970A00353F51 /* PBXTargetDependency */, 367 | ); 368 | name = BayesianKit; 369 | productInstallPath = "$(HOME)/Library/Frameworks"; 370 | productName = Bayesian; 371 | productReference = 8DC2EF5B0486A6940098B216 /* BayesianKit.framework */; 372 | productType = "com.apple.product-type.framework"; 373 | }; 374 | E2A323DA115CF00D00E4D006 /* Bayes */ = { 375 | isa = PBXNativeTarget; 376 | buildConfigurationList = E2A323E2115CF03700E4D006 /* Build configuration list for PBXNativeTarget "Bayes" */; 377 | buildPhases = ( 378 | E2A323D8115CF00D00E4D006 /* Sources */, 379 | E2A323D9115CF00D00E4D006 /* Frameworks */, 380 | ); 381 | buildRules = ( 382 | ); 383 | dependencies = ( 384 | E2A323E0115CF01200E4D006 /* PBXTargetDependency */, 385 | ); 386 | name = Bayes; 387 | productName = Test; 388 | productReference = E26C14C5115E817B00CFCCF1 /* bayes */; 389 | productType = "com.apple.product-type.tool"; 390 | }; 391 | /* End PBXNativeTarget section */ 392 | 393 | /* Begin PBXProject section */ 394 | 0867D690FE84028FC02AAC07 /* Project object */ = { 395 | isa = PBXProject; 396 | buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "BayesianKit" */; 397 | compatibilityVersion = "Xcode 3.1"; 398 | developmentRegion = English; 399 | hasScannedForEncodings = 1; 400 | knownRegions = ( 401 | en, 402 | ); 403 | mainGroup = 0867D691FE84028FC02AAC07 /* Bayesian */; 404 | productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; 405 | projectDirPath = ""; 406 | projectReferences = ( 407 | { 408 | ProductGroup = E2259A091176997E00353F51 /* Products */; 409 | ProjectRef = E2259A081176997E00353F51 /* appledoc.xcodeproj */; 410 | }, 411 | { 412 | ProductGroup = E22599D6117696E400353F51 /* Products */; 413 | ProjectRef = E224A1D31163A4DC00AD8CA6 /* ParseKit.xcodeproj */; 414 | }, 415 | ); 416 | projectRoot = ""; 417 | targets = ( 418 | 8DC2EF4F0486A6940098B216 /* BayesianKit */, 419 | E2A323DA115CF00D00E4D006 /* Bayes */, 420 | E277E6A711753345009BCC70 /* Install Documentation */, 421 | ); 422 | }; 423 | /* End PBXProject section */ 424 | 425 | /* Begin PBXReferenceProxy section */ 426 | E22599E0117696E400353F51 /* ParseKit.framework */ = { 427 | isa = PBXReferenceProxy; 428 | fileType = wrapper.framework; 429 | path = ParseKit.framework; 430 | remoteRef = E22599DF117696E400353F51 /* PBXContainerItemProxy */; 431 | sourceTree = BUILT_PRODUCTS_DIR; 432 | }; 433 | E22599E2117696E400353F51 /* JSParseKit.framework */ = { 434 | isa = PBXReferenceProxy; 435 | fileType = wrapper.framework; 436 | path = JSParseKit.framework; 437 | remoteRef = E22599E1117696E400353F51 /* PBXContainerItemProxy */; 438 | sourceTree = BUILT_PRODUCTS_DIR; 439 | }; 440 | E22599E4117696E400353F51 /* libparsekit.a */ = { 441 | isa = PBXReferenceProxy; 442 | fileType = archive.ar; 443 | path = libparsekit.a; 444 | remoteRef = E22599E3117696E400353F51 /* PBXContainerItemProxy */; 445 | sourceTree = BUILT_PRODUCTS_DIR; 446 | }; 447 | E22599E6117696E400353F51 /* Tests.octest */ = { 448 | isa = PBXReferenceProxy; 449 | fileType = wrapper.cfbundle; 450 | path = Tests.octest; 451 | remoteRef = E22599E5117696E400353F51 /* PBXContainerItemProxy */; 452 | sourceTree = BUILT_PRODUCTS_DIR; 453 | }; 454 | E22599E8117696E400353F51 /* DemoApp.app */ = { 455 | isa = PBXReferenceProxy; 456 | fileType = wrapper.application; 457 | path = DemoApp.app; 458 | remoteRef = E22599E7117696E400353F51 /* PBXContainerItemProxy */; 459 | sourceTree = BUILT_PRODUCTS_DIR; 460 | }; 461 | E22599EA117696E400353F51 /* DebugApp.app */ = { 462 | isa = PBXReferenceProxy; 463 | fileType = wrapper.application; 464 | path = DebugApp.app; 465 | remoteRef = E22599E9117696E400353F51 /* PBXContainerItemProxy */; 466 | sourceTree = BUILT_PRODUCTS_DIR; 467 | }; 468 | E22599EC117696E400353F51 /* JSDemoApp.app */ = { 469 | isa = PBXReferenceProxy; 470 | fileType = wrapper.application; 471 | path = JSDemoApp.app; 472 | remoteRef = E22599EB117696E400353F51 /* PBXContainerItemProxy */; 473 | sourceTree = BUILT_PRODUCTS_DIR; 474 | }; 475 | E2259A131176997E00353F51 /* appledoc */ = { 476 | isa = PBXReferenceProxy; 477 | fileType = "compiled.mach-o.executable"; 478 | path = appledoc; 479 | remoteRef = E2259A121176997E00353F51 /* PBXContainerItemProxy */; 480 | sourceTree = BUILT_PRODUCTS_DIR; 481 | }; 482 | /* End PBXReferenceProxy section */ 483 | 484 | /* Begin PBXResourcesBuildPhase section */ 485 | 8DC2EF520486A6940098B216 /* Resources */ = { 486 | isa = PBXResourcesBuildPhase; 487 | buildActionMask = 2147483647; 488 | files = ( 489 | 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */, 490 | ); 491 | runOnlyForDeploymentPostprocessing = 0; 492 | }; 493 | /* End PBXResourcesBuildPhase section */ 494 | 495 | /* Begin PBXShellScriptBuildPhase section */ 496 | E277E6A611753345009BCC70 /* ShellScript */ = { 497 | isa = PBXShellScriptBuildPhase; 498 | buildActionMask = 2147483647; 499 | files = ( 500 | ); 501 | inputPaths = ( 502 | ); 503 | outputPaths = ( 504 | ); 505 | runOnlyForDeploymentPostprocessing = 0; 506 | shellPath = /bin/sh; 507 | shellScript = "DOXYGEN=\"/usr/local/bin/doxygen\"\nAPPLEDOC_PATH=\"$SRCROOT/external/appledoc/\"\nAPPLEDOC=\"$APPLEDOC_PATH/build/$CONFIGURATION/appledoc\"\n\n\"$APPLEDOC\" -p \"$PROJECT_NAME\" \\\n -i \"$SRCROOT\" \\\n -o \"$SRCROOT/docs\" \\\n -t \"$APPLEDOC_PATH/Templates\" \\\n -d \"$DOXYGEN\" \\\n -c Doxyfile \\\n --docset \\\n --xhtml\n\nexit 0"; 508 | }; 509 | /* End PBXShellScriptBuildPhase section */ 510 | 511 | /* Begin PBXSourcesBuildPhase section */ 512 | 8DC2EF540486A6940098B216 /* Sources */ = { 513 | isa = PBXSourcesBuildPhase; 514 | buildActionMask = 2147483647; 515 | files = ( 516 | E26C145F115E324100CFCCF1 /* BKClassifier.m in Sources */, 517 | E26C1461115E324100CFCCF1 /* BKDataPool.m in Sources */, 518 | E26C1463115E324100CFCCF1 /* BKTokenData.m in Sources */, 519 | E26C1465115E324100CFCCF1 /* BKTokenizer.m in Sources */, 520 | ); 521 | runOnlyForDeploymentPostprocessing = 0; 522 | }; 523 | E2A323D8115CF00D00E4D006 /* Sources */ = { 524 | isa = PBXSourcesBuildPhase; 525 | buildActionMask = 2147483647; 526 | files = ( 527 | E26C1475115E329F00CFCCF1 /* main.m in Sources */, 528 | E26C14E2115E838F00CFCCF1 /* Bayes.m in Sources */, 529 | E26C153E115E8E8A00CFCCF1 /* Utils.m in Sources */, 530 | ); 531 | runOnlyForDeploymentPostprocessing = 0; 532 | }; 533 | /* End PBXSourcesBuildPhase section */ 534 | 535 | /* Begin PBXTargetDependency section */ 536 | E22599F21176970A00353F51 /* PBXTargetDependency */ = { 537 | isa = PBXTargetDependency; 538 | name = ParseKit; 539 | targetProxy = E22599F11176970A00353F51 /* PBXContainerItemProxy */; 540 | }; 541 | E2259A151176998800353F51 /* PBXTargetDependency */ = { 542 | isa = PBXTargetDependency; 543 | name = appledoc; 544 | targetProxy = E2259A141176998800353F51 /* PBXContainerItemProxy */; 545 | }; 546 | E2A323E0115CF01200E4D006 /* PBXTargetDependency */ = { 547 | isa = PBXTargetDependency; 548 | target = 8DC2EF4F0486A6940098B216 /* BayesianKit */; 549 | targetProxy = E2A323DF115CF01200E4D006 /* PBXContainerItemProxy */; 550 | }; 551 | /* End PBXTargetDependency section */ 552 | 553 | /* Begin PBXVariantGroup section */ 554 | 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { 555 | isa = PBXVariantGroup; 556 | children = ( 557 | 089C1667FE841158C02AAC07 /* English */, 558 | ); 559 | name = InfoPlist.strings; 560 | sourceTree = ""; 561 | }; 562 | /* End PBXVariantGroup section */ 563 | 564 | /* Begin XCBuildConfiguration section */ 565 | 1DEB91AE08733DA50010E9CD /* Debug */ = { 566 | isa = XCBuildConfiguration; 567 | buildSettings = { 568 | ALWAYS_SEARCH_USER_PATHS = YES; 569 | COPY_PHASE_STRIP = NO; 570 | CURRENT_PROJECT_VERSION = 0.1; 571 | DYLIB_COMPATIBILITY_VERSION = 1; 572 | DYLIB_CURRENT_VERSION = 1; 573 | DYLIB_INSTALL_NAME_BASE = "$(INSTALL_PATH)"; 574 | FRAMEWORK_VERSION = A; 575 | GCC_DYNAMIC_NO_PIC = NO; 576 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 577 | GCC_ENABLE_OBJC_GC = supported; 578 | GCC_MODEL_TUNING = G5; 579 | GCC_OPTIMIZATION_LEVEL = 0; 580 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 581 | GCC_PREFIX_HEADER = BayesianKit_Prefix.pch; 582 | GCC_VERSION = ""; 583 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 584 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES; 585 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 586 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES; 587 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; 588 | GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; 589 | GCC_WARN_INHIBIT_ALL_WARNINGS = NO; 590 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; 591 | GCC_WARN_MISSING_PARENTHESES = YES; 592 | GCC_WARN_MULTIPLE_DEFINITION_TYPES_FOR_SELECTOR = NO; 593 | GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; 594 | GCC_WARN_PEDANTIC = NO; 595 | GCC_WARN_PROTOTYPE_CONVERSION = NO; 596 | GCC_WARN_SHADOW = YES; 597 | GCC_WARN_SIGN_COMPARE = YES; 598 | GCC_WARN_STRICT_SELECTOR_MATCH = NO; 599 | GCC_WARN_UNDECLARED_SELECTOR = YES; 600 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 601 | GCC_WARN_UNUSED_FUNCTION = YES; 602 | GCC_WARN_UNUSED_LABEL = YES; 603 | GCC_WARN_UNUSED_PARAMETER = YES; 604 | GCC_WARN_UNUSED_VALUE = YES; 605 | GENERATE_PROFILING_CODE = YES; 606 | INFOPLIST_FILE = Info.plist; 607 | INSTALL_PATH = "$(TARGET_BUILD_DIR)"; 608 | PRODUCT_NAME = BayesianKit; 609 | RUN_CLANG_STATIC_ANALYZER = YES; 610 | SDKROOT = ""; 611 | WARNING_CFLAGS = ( 612 | "-Wextra", 613 | "-Wall", 614 | "-Winvalid-pch", 615 | ); 616 | WRAPPER_EXTENSION = framework; 617 | ZERO_LINK = YES; 618 | }; 619 | name = Debug; 620 | }; 621 | 1DEB91AF08733DA50010E9CD /* Release */ = { 622 | isa = XCBuildConfiguration; 623 | buildSettings = { 624 | ALWAYS_SEARCH_USER_PATHS = NO; 625 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 626 | DYLIB_COMPATIBILITY_VERSION = 1; 627 | DYLIB_CURRENT_VERSION = 1; 628 | DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks"; 629 | FRAMEWORK_VERSION = A; 630 | GCC_MODEL_TUNING = G5; 631 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 632 | GCC_PREFIX_HEADER = BayesianKit_Prefix.pch; 633 | GCC_VERSION = ""; 634 | INFOPLIST_FILE = Info.plist; 635 | INSTALL_PATH = "$(HOME)/Library/Frameworks"; 636 | PRODUCT_NAME = BayesianKit; 637 | WRAPPER_EXTENSION = framework; 638 | }; 639 | name = Release; 640 | }; 641 | 1DEB91B208733DA50010E9CD /* Debug */ = { 642 | isa = XCBuildConfiguration; 643 | buildSettings = { 644 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 645 | GCC_C_LANGUAGE_STANDARD = gnu99; 646 | GCC_OPTIMIZATION_LEVEL = 0; 647 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 648 | GCC_WARN_UNUSED_VARIABLE = YES; 649 | ONLY_ACTIVE_ARCH = YES; 650 | PREBINDING = NO; 651 | SDKROOT = macosx10.6; 652 | }; 653 | name = Debug; 654 | }; 655 | 1DEB91B308733DA50010E9CD /* Release */ = { 656 | isa = XCBuildConfiguration; 657 | buildSettings = { 658 | ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; 659 | GCC_C_LANGUAGE_STANDARD = gnu99; 660 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 661 | GCC_WARN_UNUSED_VARIABLE = YES; 662 | PREBINDING = NO; 663 | SDKROOT = macosx10.6; 664 | }; 665 | name = Release; 666 | }; 667 | E277E6A811753345009BCC70 /* Debug */ = { 668 | isa = XCBuildConfiguration; 669 | buildSettings = { 670 | COPY_PHASE_STRIP = NO; 671 | GCC_DYNAMIC_NO_PIC = NO; 672 | GCC_OPTIMIZATION_LEVEL = 0; 673 | PRODUCT_NAME = Documentation; 674 | }; 675 | name = Debug; 676 | }; 677 | E277E6A911753345009BCC70 /* Release */ = { 678 | isa = XCBuildConfiguration; 679 | buildSettings = { 680 | COPY_PHASE_STRIP = YES; 681 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 682 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 683 | PRODUCT_NAME = Documentation; 684 | ZERO_LINK = NO; 685 | }; 686 | name = Release; 687 | }; 688 | E2A323DD115CF00E00E4D006 /* Debug */ = { 689 | isa = XCBuildConfiguration; 690 | buildSettings = { 691 | ALWAYS_SEARCH_USER_PATHS = YES; 692 | COPY_PHASE_STRIP = NO; 693 | CURRENT_PROJECT_VERSION = 0.1; 694 | FRAMEWORK_SEARCH_PATHS = ""; 695 | GCC_DYNAMIC_NO_PIC = NO; 696 | GCC_ENABLE_FIX_AND_CONTINUE = YES; 697 | GCC_MODEL_TUNING = G5; 698 | GCC_OPTIMIZATION_LEVEL = 0; 699 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 700 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 701 | GCC_VERSION = ""; 702 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 703 | GCC_WARN_ABOUT_MISSING_NEWLINE = YES; 704 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 705 | GCC_WARN_CHECK_SWITCH_STATEMENTS = YES; 706 | GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; 707 | GCC_WARN_INHIBIT_ALL_WARNINGS = YES; 708 | GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; 709 | GCC_WARN_MISSING_PARENTHESES = YES; 710 | GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; 711 | GCC_WARN_SHADOW = YES; 712 | GCC_WARN_SIGN_COMPARE = YES; 713 | GCC_WARN_UNDECLARED_SELECTOR = YES; 714 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 715 | GCC_WARN_UNKNOWN_PRAGMAS = NO; 716 | GCC_WARN_UNUSED_FUNCTION = YES; 717 | GCC_WARN_UNUSED_LABEL = YES; 718 | GCC_WARN_UNUSED_PARAMETER = YES; 719 | GCC_WARN_UNUSED_VALUE = YES; 720 | HEADER_SEARCH_PATHS = ""; 721 | INSTALL_PATH = /usr/local/bin; 722 | OTHER_LDFLAGS = ( 723 | "-framework", 724 | Foundation, 725 | "-framework", 726 | AppKit, 727 | ); 728 | PREBINDING = NO; 729 | PRODUCT_NAME = bayes; 730 | SDKROOT = ""; 731 | WARNING_CFLAGS = ( 732 | "-Wextra", 733 | "-Wall", 734 | ); 735 | }; 736 | name = Debug; 737 | }; 738 | E2A323DE115CF00E00E4D006 /* Release */ = { 739 | isa = XCBuildConfiguration; 740 | buildSettings = { 741 | ALWAYS_SEARCH_USER_PATHS = NO; 742 | COPY_PHASE_STRIP = YES; 743 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 744 | GCC_ENABLE_FIX_AND_CONTINUE = NO; 745 | GCC_MODEL_TUNING = G5; 746 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 747 | GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; 748 | GCC_VERSION = ""; 749 | INSTALL_PATH = /usr/local/bin; 750 | OTHER_LDFLAGS = ( 751 | "-framework", 752 | Foundation, 753 | "-framework", 754 | AppKit, 755 | ); 756 | PREBINDING = NO; 757 | PRODUCT_NAME = Test; 758 | SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = NO; 759 | ZERO_LINK = NO; 760 | }; 761 | name = Release; 762 | }; 763 | /* End XCBuildConfiguration section */ 764 | 765 | /* Begin XCConfigurationList section */ 766 | 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "BayesianKit" */ = { 767 | isa = XCConfigurationList; 768 | buildConfigurations = ( 769 | 1DEB91AE08733DA50010E9CD /* Debug */, 770 | 1DEB91AF08733DA50010E9CD /* Release */, 771 | ); 772 | defaultConfigurationIsVisible = 0; 773 | defaultConfigurationName = Release; 774 | }; 775 | 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "BayesianKit" */ = { 776 | isa = XCConfigurationList; 777 | buildConfigurations = ( 778 | 1DEB91B208733DA50010E9CD /* Debug */, 779 | 1DEB91B308733DA50010E9CD /* Release */, 780 | ); 781 | defaultConfigurationIsVisible = 0; 782 | defaultConfigurationName = Release; 783 | }; 784 | E277E6AA11753363009BCC70 /* Build configuration list for PBXAggregateTarget "Install Documentation" */ = { 785 | isa = XCConfigurationList; 786 | buildConfigurations = ( 787 | E277E6A811753345009BCC70 /* Debug */, 788 | E277E6A911753345009BCC70 /* Release */, 789 | ); 790 | defaultConfigurationIsVisible = 0; 791 | defaultConfigurationName = Release; 792 | }; 793 | E2A323E2115CF03700E4D006 /* Build configuration list for PBXNativeTarget "Bayes" */ = { 794 | isa = XCConfigurationList; 795 | buildConfigurations = ( 796 | E2A323DD115CF00E00E4D006 /* Debug */, 797 | E2A323DE115CF00E00E4D006 /* Release */, 798 | ); 799 | defaultConfigurationIsVisible = 0; 800 | defaultConfigurationName = Release; 801 | }; 802 | /* End XCConfigurationList section */ 803 | }; 804 | rootObject = 0867D690FE84028FC02AAC07 /* Project object */; 805 | } 806 | -------------------------------------------------------------------------------- /BayesianKit_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Bayesian' target in the 'Bayesian' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /DocSet-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | net.ᐱ.BayesianKit.docset 7 | CFBundleName 8 | BayesianKit 9 | DocSetFeedName 10 | BayesianKit documentation 11 | 12 | 13 | -------------------------------------------------------------------------------- /Doxyfile: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.6.3 2 | 3 | # This file describes the settings to be used by the documentation system 4 | # doxygen (www.doxygen.org) for a project 5 | # 6 | # All text after a hash (#) is considered a comment and will be ignored 7 | # The format is: 8 | # TAG = value [value, ...] 9 | # For lists items can also be appended using: 10 | # TAG += value [value, ...] 11 | # Values that contain spaces should be placed between quotes (" ") 12 | 13 | #--------------------------------------------------------------------------- 14 | # Project related configuration options 15 | #--------------------------------------------------------------------------- 16 | 17 | # This tag specifies the encoding used for all characters in the config file 18 | # that follow. The default is UTF-8 which is also the encoding used for all 19 | # text before the first occurrence of this tag. Doxygen uses libiconv (or the 20 | # iconv built into libc) for the transcoding. See 21 | # http://www.gnu.org/software/libiconv for the list of possible encodings. 22 | 23 | DOXYFILE_ENCODING = UTF-8 24 | 25 | # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 26 | # by quotes) that should identify the project. 27 | 28 | PROJECT_NAME = BayesianKit 29 | 30 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. 31 | # This could be handy for archiving the generated documentation or 32 | # if some version control system is used. 33 | 34 | PROJECT_NUMBER = 0.1 35 | 36 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 37 | # base path where the generated documentation will be put. 38 | # If a relative path is entered, it will be relative to the location 39 | # where doxygen was started. If left blank the current directory will be used. 40 | 41 | OUTPUT_DIRECTORY = docs 42 | 43 | # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 44 | # 4096 sub-directories (in 2 levels) under the output directory of each output 45 | # format and will distribute the generated files over these directories. 46 | # Enabling this option can be useful when feeding doxygen a huge amount of 47 | # source files, where putting all generated files in the same directory would 48 | # otherwise cause performance problems for the file system. 49 | 50 | CREATE_SUBDIRS = NO 51 | 52 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all 53 | # documentation generated by doxygen is written. Doxygen will use this 54 | # information to generate all constant output in the proper language. 55 | # The default language is English, other supported languages are: 56 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 57 | # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 58 | # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 59 | # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 60 | # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, 61 | # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. 62 | 63 | OUTPUT_LANGUAGE = English 64 | 65 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 66 | # include brief member descriptions after the members that are listed in 67 | # the file and class documentation (similar to JavaDoc). 68 | # Set to NO to disable this. 69 | 70 | BRIEF_MEMBER_DESC = YES 71 | 72 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 73 | # the brief description of a member or function before the detailed description. 74 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 75 | # brief descriptions will be completely suppressed. 76 | 77 | REPEAT_BRIEF = YES 78 | 79 | # This tag implements a quasi-intelligent brief description abbreviator 80 | # that is used to form the text in various listings. Each string 81 | # in this list, if found as the leading text of the brief description, will be 82 | # stripped from the text and the result after processing the whole list, is 83 | # used as the annotated text. Otherwise, the brief description is used as-is. 84 | # If left blank, the following values are used ("$name" is automatically 85 | # replaced with the name of the entity): "The $name class" "The $name widget" 86 | # "The $name file" "is" "provides" "specifies" "contains" 87 | # "represents" "a" "an" "the" 88 | 89 | ABBREVIATE_BRIEF = "The $name class" \ 90 | "The $name widget" \ 91 | "The $name file" \ 92 | is \ 93 | provides \ 94 | specifies \ 95 | contains \ 96 | represents \ 97 | a \ 98 | an \ 99 | the 100 | 101 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 102 | # Doxygen will generate a detailed section even if there is only a brief 103 | # description. 104 | 105 | ALWAYS_DETAILED_SEC = NO 106 | 107 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 108 | # inherited members of a class in the documentation of that class as if those 109 | # members were ordinary class members. Constructors, destructors and assignment 110 | # operators of the base classes will not be shown. 111 | 112 | INLINE_INHERITED_MEMB = NO 113 | 114 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 115 | # path before files name in the file list and in the header files. If set 116 | # to NO the shortest path that makes the file name unique will be used. 117 | 118 | FULL_PATH_NAMES = YES 119 | 120 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 121 | # can be used to strip a user-defined part of the path. Stripping is 122 | # only done if one of the specified strings matches the left-hand part of 123 | # the path. The tag can be used to show relative paths in the file list. 124 | # If left blank the directory from which doxygen is run is used as the 125 | # path to strip. 126 | 127 | STRIP_FROM_PATH = 128 | 129 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 130 | # the path mentioned in the documentation of a class, which tells 131 | # the reader which header file to include in order to use a class. 132 | # If left blank only the name of the header file containing the class 133 | # definition is used. Otherwise one should specify the include paths that 134 | # are normally passed to the compiler using the -I flag. 135 | 136 | STRIP_FROM_INC_PATH = 137 | 138 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 139 | # (but less readable) file names. This can be useful is your file systems 140 | # doesn't support long names like on DOS, Mac, or CD-ROM. 141 | 142 | SHORT_NAMES = NO 143 | 144 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 145 | # will interpret the first line (until the first dot) of a JavaDoc-style 146 | # comment as the brief description. If set to NO, the JavaDoc 147 | # comments will behave just like regular Qt-style comments 148 | # (thus requiring an explicit @brief command for a brief description.) 149 | 150 | JAVADOC_AUTOBRIEF = YES 151 | 152 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will 153 | # interpret the first line (until the first dot) of a Qt-style 154 | # comment as the brief description. If set to NO, the comments 155 | # will behave just like regular Qt-style comments (thus requiring 156 | # an explicit \brief command for a brief description.) 157 | 158 | QT_AUTOBRIEF = NO 159 | 160 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 161 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// 162 | # comments) as a brief description. This used to be the default behaviour. 163 | # The new default is to treat a multi-line C++ comment block as a detailed 164 | # description. Set this tag to YES if you prefer the old behaviour instead. 165 | 166 | MULTILINE_CPP_IS_BRIEF = NO 167 | 168 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 169 | # member inherits the documentation from any documented member that it 170 | # re-implements. 171 | 172 | INHERIT_DOCS = YES 173 | 174 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 175 | # a new page for each member. If set to NO, the documentation of a member will 176 | # be part of the file/class/namespace that contains it. 177 | 178 | SEPARATE_MEMBER_PAGES = NO 179 | 180 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. 181 | # Doxygen uses this value to replace tabs by spaces in code fragments. 182 | 183 | TAB_SIZE = 8 184 | 185 | # This tag can be used to specify a number of aliases that acts 186 | # as commands in the documentation. An alias has the form "name=value". 187 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to 188 | # put the command \sideeffect (or @sideeffect) in the documentation, which 189 | # will result in a user-defined paragraph with heading "Side Effects:". 190 | # You can put \n's in the value part of an alias to insert newlines. 191 | 192 | ALIASES = 193 | 194 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 195 | # sources only. Doxygen will then generate output that is more tailored for C. 196 | # For instance, some of the names that are used will be different. The list 197 | # of all members will be omitted, etc. 198 | 199 | OPTIMIZE_OUTPUT_FOR_C = NO 200 | 201 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 202 | # sources only. Doxygen will then generate output that is more tailored for 203 | # Java. For instance, namespaces will be presented as packages, qualified 204 | # scopes will look different, etc. 205 | 206 | OPTIMIZE_OUTPUT_JAVA = NO 207 | 208 | # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 209 | # sources only. Doxygen will then generate output that is more tailored for 210 | # Fortran. 211 | 212 | OPTIMIZE_FOR_FORTRAN = NO 213 | 214 | # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 215 | # sources. Doxygen will then generate output that is tailored for 216 | # VHDL. 217 | 218 | OPTIMIZE_OUTPUT_VHDL = NO 219 | 220 | # Doxygen selects the parser to use depending on the extension of the files it parses. 221 | # With this tag you can assign which parser to use for a given extension. 222 | # Doxygen has a built-in mapping, but you can override or extend it using this tag. 223 | # The format is ext=language, where ext is a file extension, and language is one of 224 | # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, 225 | # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat 226 | # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), 227 | # use: inc=Fortran f=C. Note that for custom extensions you also need to set 228 | # FILE_PATTERNS otherwise the files are not read by doxygen. 229 | 230 | EXTENSION_MAPPING = 231 | 232 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 233 | # to include (a tag file for) the STL sources as input, then you should 234 | # set this tag to YES in order to let doxygen match functions declarations and 235 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 236 | # func(std::string) {}). This also make the inheritance and collaboration 237 | # diagrams that involve STL classes more complete and accurate. 238 | 239 | BUILTIN_STL_SUPPORT = NO 240 | 241 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 242 | # enable parsing support. 243 | 244 | CPP_CLI_SUPPORT = NO 245 | 246 | # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 247 | # Doxygen will parse them like normal C++ but will assume all classes use public 248 | # instead of private inheritance when no explicit protection keyword is present. 249 | 250 | SIP_SUPPORT = NO 251 | 252 | # For Microsoft's IDL there are propget and propput attributes to indicate getter 253 | # and setter methods for a property. Setting this option to YES (the default) 254 | # will make doxygen to replace the get and set methods by a property in the 255 | # documentation. This will only work if the methods are indeed getting or 256 | # setting a simple type. If this is not the case, or you want to show the 257 | # methods anyway, you should set this option to NO. 258 | 259 | IDL_PROPERTY_SUPPORT = YES 260 | 261 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 262 | # tag is set to YES, then doxygen will reuse the documentation of the first 263 | # member in the group (if any) for the other members of the group. By default 264 | # all members of a group must be documented explicitly. 265 | 266 | DISTRIBUTE_GROUP_DOC = NO 267 | 268 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 269 | # the same type (for instance a group of public functions) to be put as a 270 | # subgroup of that type (e.g. under the Public Functions section). Set it to 271 | # NO to prevent subgrouping. Alternatively, this can be done per class using 272 | # the \nosubgrouping command. 273 | 274 | SUBGROUPING = YES 275 | 276 | # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 277 | # is documented as struct, union, or enum with the name of the typedef. So 278 | # typedef struct TypeS {} TypeT, will appear in the documentation as a struct 279 | # with name TypeT. When disabled the typedef will appear as a member of a file, 280 | # namespace, or class. And the struct will be named TypeS. This can typically 281 | # be useful for C code in case the coding convention dictates that all compound 282 | # types are typedef'ed and only the typedef is referenced, never the tag name. 283 | 284 | TYPEDEF_HIDES_STRUCT = NO 285 | 286 | # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 287 | # determine which symbols to keep in memory and which to flush to disk. 288 | # When the cache is full, less often used symbols will be written to disk. 289 | # For small to medium size projects (<1000 input files) the default value is 290 | # probably good enough. For larger projects a too small cache size can cause 291 | # doxygen to be busy swapping symbols to and from disk most of the time 292 | # causing a significant performance penality. 293 | # If the system has enough physical memory increasing the cache will improve the 294 | # performance by keeping more symbols in memory. Note that the value works on 295 | # a logarithmic scale so increasing the size by one will rougly double the 296 | # memory usage. The cache size is given by this formula: 297 | # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 298 | # corresponding to a cache size of 2^16 = 65536 symbols 299 | 300 | SYMBOL_CACHE_SIZE = 0 301 | 302 | #--------------------------------------------------------------------------- 303 | # Build related configuration options 304 | #--------------------------------------------------------------------------- 305 | 306 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 307 | # documentation are documented, even if no documentation was available. 308 | # Private class members and static file members will be hidden unless 309 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 310 | 311 | EXTRACT_ALL = NO 312 | 313 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 314 | # will be included in the documentation. 315 | 316 | EXTRACT_PRIVATE = NO 317 | 318 | # If the EXTRACT_STATIC tag is set to YES all static members of a file 319 | # will be included in the documentation. 320 | 321 | EXTRACT_STATIC = NO 322 | 323 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 324 | # defined locally in source files will be included in the documentation. 325 | # If set to NO only classes defined in header files are included. 326 | 327 | EXTRACT_LOCAL_CLASSES = YES 328 | 329 | # This flag is only useful for Objective-C code. When set to YES local 330 | # methods, which are defined in the implementation section but not in 331 | # the interface are included in the documentation. 332 | # If set to NO (the default) only methods in the interface are included. 333 | 334 | EXTRACT_LOCAL_METHODS = NO 335 | 336 | # If this flag is set to YES, the members of anonymous namespaces will be 337 | # extracted and appear in the documentation as a namespace called 338 | # 'anonymous_namespace{file}', where file will be replaced with the base 339 | # name of the file that contains the anonymous namespace. By default 340 | # anonymous namespace are hidden. 341 | 342 | EXTRACT_ANON_NSPACES = NO 343 | 344 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 345 | # undocumented members of documented classes, files or namespaces. 346 | # If set to NO (the default) these members will be included in the 347 | # various overviews, but no documentation section is generated. 348 | # This option has no effect if EXTRACT_ALL is enabled. 349 | 350 | HIDE_UNDOC_MEMBERS = NO 351 | 352 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 353 | # undocumented classes that are normally visible in the class hierarchy. 354 | # If set to NO (the default) these classes will be included in the various 355 | # overviews. This option has no effect if EXTRACT_ALL is enabled. 356 | 357 | HIDE_UNDOC_CLASSES = NO 358 | 359 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 360 | # friend (class|struct|union) declarations. 361 | # If set to NO (the default) these declarations will be included in the 362 | # documentation. 363 | 364 | HIDE_FRIEND_COMPOUNDS = NO 365 | 366 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 367 | # documentation blocks found inside the body of a function. 368 | # If set to NO (the default) these blocks will be appended to the 369 | # function's detailed documentation block. 370 | 371 | HIDE_IN_BODY_DOCS = NO 372 | 373 | # The INTERNAL_DOCS tag determines if documentation 374 | # that is typed after a \internal command is included. If the tag is set 375 | # to NO (the default) then the documentation will be excluded. 376 | # Set it to YES to include the internal documentation. 377 | 378 | INTERNAL_DOCS = NO 379 | 380 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 381 | # file names in lower-case letters. If set to YES upper-case letters are also 382 | # allowed. This is useful if you have classes or files whose names only differ 383 | # in case and if your file system supports case sensitive file names. Windows 384 | # and Mac users are advised to set this option to NO. 385 | 386 | CASE_SENSE_NAMES = NO 387 | 388 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 389 | # will show members with their full class and namespace scopes in the 390 | # documentation. If set to YES the scope will be hidden. 391 | 392 | HIDE_SCOPE_NAMES = YES 393 | 394 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 395 | # will put a list of the files that are included by a file in the documentation 396 | # of that file. 397 | 398 | SHOW_INCLUDE_FILES = YES 399 | 400 | # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 401 | # will list include files with double quotes in the documentation 402 | # rather than with sharp brackets. 403 | 404 | FORCE_LOCAL_INCLUDES = NO 405 | 406 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 407 | # is inserted in the documentation for inline members. 408 | 409 | INLINE_INFO = YES 410 | 411 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 412 | # will sort the (detailed) documentation of file and class members 413 | # alphabetically by member name. If set to NO the members will appear in 414 | # declaration order. 415 | 416 | SORT_MEMBER_DOCS = YES 417 | 418 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 419 | # brief documentation of file, namespace and class members alphabetically 420 | # by member name. If set to NO (the default) the members will appear in 421 | # declaration order. 422 | 423 | SORT_BRIEF_DOCS = NO 424 | 425 | # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 426 | # will sort the (brief and detailed) documentation of class members so that 427 | # constructors and destructors are listed first. If set to NO (the default) 428 | # the constructors will appear in the respective orders defined by 429 | # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 430 | # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 431 | # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. 432 | 433 | SORT_MEMBERS_CTORS_1ST = NO 434 | 435 | # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 436 | # hierarchy of group names into alphabetical order. If set to NO (the default) 437 | # the group names will appear in their defined order. 438 | 439 | SORT_GROUP_NAMES = NO 440 | 441 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 442 | # sorted by fully-qualified names, including namespaces. If set to 443 | # NO (the default), the class list will be sorted only by class name, 444 | # not including the namespace part. 445 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 446 | # Note: This option applies only to the class list, not to the 447 | # alphabetical list. 448 | 449 | SORT_BY_SCOPE_NAME = NO 450 | 451 | # The GENERATE_TODOLIST tag can be used to enable (YES) or 452 | # disable (NO) the todo list. This list is created by putting \todo 453 | # commands in the documentation. 454 | 455 | GENERATE_TODOLIST = YES 456 | 457 | # The GENERATE_TESTLIST tag can be used to enable (YES) or 458 | # disable (NO) the test list. This list is created by putting \test 459 | # commands in the documentation. 460 | 461 | GENERATE_TESTLIST = YES 462 | 463 | # The GENERATE_BUGLIST tag can be used to enable (YES) or 464 | # disable (NO) the bug list. This list is created by putting \bug 465 | # commands in the documentation. 466 | 467 | GENERATE_BUGLIST = YES 468 | 469 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 470 | # disable (NO) the deprecated list. This list is created by putting 471 | # \deprecated commands in the documentation. 472 | 473 | GENERATE_DEPRECATEDLIST= YES 474 | 475 | # The ENABLED_SECTIONS tag can be used to enable conditional 476 | # documentation sections, marked by \if sectionname ... \endif. 477 | 478 | ENABLED_SECTIONS = 479 | 480 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 481 | # the initial value of a variable or define consists of for it to appear in 482 | # the documentation. If the initializer consists of more lines than specified 483 | # here it will be hidden. Use a value of 0 to hide initializers completely. 484 | # The appearance of the initializer of individual variables and defines in the 485 | # documentation can be controlled using \showinitializer or \hideinitializer 486 | # command in the documentation regardless of this setting. 487 | 488 | MAX_INITIALIZER_LINES = 30 489 | 490 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 491 | # at the bottom of the documentation of classes and structs. If set to YES the 492 | # list will mention the files that were used to generate the documentation. 493 | 494 | SHOW_USED_FILES = YES 495 | 496 | # If the sources in your project are distributed over multiple directories 497 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 498 | # in the documentation. The default is NO. 499 | 500 | SHOW_DIRECTORIES = NO 501 | 502 | # Set the SHOW_FILES tag to NO to disable the generation of the Files page. 503 | # This will remove the Files entry from the Quick Index and from the 504 | # Folder Tree View (if specified). The default is YES. 505 | 506 | SHOW_FILES = YES 507 | 508 | # Set the SHOW_NAMESPACES tag to NO to disable the generation of the 509 | # Namespaces page. This will remove the Namespaces entry from the Quick Index 510 | # and from the Folder Tree View (if specified). The default is YES. 511 | 512 | SHOW_NAMESPACES = YES 513 | 514 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 515 | # doxygen should invoke to get the current version for each file (typically from 516 | # the version control system). Doxygen will invoke the program by executing (via 517 | # popen()) the command , where is the value of 518 | # the FILE_VERSION_FILTER tag, and is the name of an input file 519 | # provided by doxygen. Whatever the program writes to standard output 520 | # is used as the file version. See the manual for examples. 521 | 522 | FILE_VERSION_FILTER = 523 | 524 | # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by 525 | # doxygen. The layout file controls the global structure of the generated output files 526 | # in an output format independent way. The create the layout file that represents 527 | # doxygen's defaults, run doxygen with the -l option. You can optionally specify a 528 | # file name after the option, if omitted DoxygenLayout.xml will be used as the name 529 | # of the layout file. 530 | 531 | LAYOUT_FILE = 532 | 533 | #--------------------------------------------------------------------------- 534 | # configuration options related to warning and progress messages 535 | #--------------------------------------------------------------------------- 536 | 537 | # The QUIET tag can be used to turn on/off the messages that are generated 538 | # by doxygen. Possible values are YES and NO. If left blank NO is used. 539 | 540 | QUIET = NO 541 | 542 | # The WARNINGS tag can be used to turn on/off the warning messages that are 543 | # generated by doxygen. Possible values are YES and NO. If left blank 544 | # NO is used. 545 | 546 | WARNINGS = YES 547 | 548 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 549 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 550 | # automatically be disabled. 551 | 552 | WARN_IF_UNDOCUMENTED = YES 553 | 554 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 555 | # potential errors in the documentation, such as not documenting some 556 | # parameters in a documented function, or documenting parameters that 557 | # don't exist or using markup commands wrongly. 558 | 559 | WARN_IF_DOC_ERROR = YES 560 | 561 | # This WARN_NO_PARAMDOC option can be abled to get warnings for 562 | # functions that are documented, but have no documentation for their parameters 563 | # or return value. If set to NO (the default) doxygen will only warn about 564 | # wrong or incomplete parameter documentation, but not about the absence of 565 | # documentation. 566 | 567 | WARN_NO_PARAMDOC = NO 568 | 569 | # The WARN_FORMAT tag determines the format of the warning messages that 570 | # doxygen can produce. The string should contain the $file, $line, and $text 571 | # tags, which will be replaced by the file and line number from which the 572 | # warning originated and the warning text. Optionally the format may contain 573 | # $version, which will be replaced by the version of the file (if it could 574 | # be obtained via FILE_VERSION_FILTER) 575 | 576 | WARN_FORMAT = "$file:$line: $text" 577 | 578 | # The WARN_LOGFILE tag can be used to specify a file to which warning 579 | # and error messages should be written. If left blank the output is written 580 | # to stderr. 581 | 582 | WARN_LOGFILE = 583 | 584 | #--------------------------------------------------------------------------- 585 | # configuration options related to the input files 586 | #--------------------------------------------------------------------------- 587 | 588 | # The INPUT tag can be used to specify the files and/or directories that contain 589 | # documented source files. You may enter file names like "myfile.cpp" or 590 | # directories like "/usr/src/myproject". Separate the files or directories 591 | # with spaces. 592 | 593 | INPUT = src 594 | 595 | # This tag can be used to specify the character encoding of the source files 596 | # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 597 | # also the default input encoding. Doxygen uses libiconv (or the iconv built 598 | # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 599 | # the list of possible encodings. 600 | 601 | INPUT_ENCODING = UTF-8 602 | 603 | # If the value of the INPUT tag contains directories, you can use the 604 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 605 | # and *.h) to filter out the source-files in the directories. If left 606 | # blank the following patterns are tested: 607 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 608 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 609 | 610 | FILE_PATTERNS = *.c \ 611 | *.cc \ 612 | *.cxx \ 613 | *.cpp \ 614 | *.c++ \ 615 | *.d \ 616 | *.java \ 617 | *.ii \ 618 | *.ixx \ 619 | *.ipp \ 620 | *.i++ \ 621 | *.inl \ 622 | *.h \ 623 | *.hh \ 624 | *.hxx \ 625 | *.hpp \ 626 | *.h++ \ 627 | *.idl \ 628 | *.odl \ 629 | *.cs \ 630 | *.php \ 631 | *.php3 \ 632 | *.inc \ 633 | *.m \ 634 | *.mm \ 635 | *.dox \ 636 | *.py \ 637 | *.f90 \ 638 | *.f \ 639 | *.vhd \ 640 | *.vhdl 641 | 642 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories 643 | # should be searched for input files as well. Possible values are YES and NO. 644 | # If left blank NO is used. 645 | 646 | RECURSIVE = YES 647 | 648 | # The EXCLUDE tag can be used to specify files and/or directories that should 649 | # excluded from the INPUT source files. This way you can easily exclude a 650 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 651 | 652 | EXCLUDE = 653 | 654 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 655 | # directories that are symbolic links (a Unix filesystem feature) are excluded 656 | # from the input. 657 | 658 | EXCLUDE_SYMLINKS = NO 659 | 660 | # If the value of the INPUT tag contains directories, you can use the 661 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 662 | # certain files from those directories. Note that the wildcards are matched 663 | # against the file with absolute path, so to exclude all test directories 664 | # for example use the pattern */test/* 665 | 666 | EXCLUDE_PATTERNS = 667 | 668 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 669 | # (namespaces, classes, functions, etc.) that should be excluded from the 670 | # output. The symbol name can be a fully qualified name, a word, or if the 671 | # wildcard * is used, a substring. Examples: ANamespace, AClass, 672 | # AClass::ANamespace, ANamespace::*Test 673 | 674 | EXCLUDE_SYMBOLS = 675 | 676 | # The EXAMPLE_PATH tag can be used to specify one or more files or 677 | # directories that contain example code fragments that are included (see 678 | # the \include command). 679 | 680 | EXAMPLE_PATH = 681 | 682 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 683 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 684 | # and *.h) to filter out the source-files in the directories. If left 685 | # blank all files are included. 686 | 687 | EXAMPLE_PATTERNS = * 688 | 689 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 690 | # searched for input files to be used with the \include or \dontinclude 691 | # commands irrespective of the value of the RECURSIVE tag. 692 | # Possible values are YES and NO. If left blank NO is used. 693 | 694 | EXAMPLE_RECURSIVE = NO 695 | 696 | # The IMAGE_PATH tag can be used to specify one or more files or 697 | # directories that contain image that are included in the documentation (see 698 | # the \image command). 699 | 700 | IMAGE_PATH = 701 | 702 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 703 | # invoke to filter for each input file. Doxygen will invoke the filter program 704 | # by executing (via popen()) the command , where 705 | # is the value of the INPUT_FILTER tag, and is the name of an 706 | # input file. Doxygen will then use the output that the filter program writes 707 | # to standard output. If FILTER_PATTERNS is specified, this tag will be 708 | # ignored. 709 | 710 | INPUT_FILTER = 711 | 712 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 713 | # basis. Doxygen will compare the file name with each pattern and apply the 714 | # filter if there is a match. The filters are a list of the form: 715 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 716 | # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 717 | # is applied to all files. 718 | 719 | FILTER_PATTERNS = 720 | 721 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 722 | # INPUT_FILTER) will be used to filter the input files when producing source 723 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). 724 | 725 | FILTER_SOURCE_FILES = NO 726 | 727 | #--------------------------------------------------------------------------- 728 | # configuration options related to source browsing 729 | #--------------------------------------------------------------------------- 730 | 731 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will 732 | # be generated. Documented entities will be cross-referenced with these sources. 733 | # Note: To get rid of all source code in the generated output, make sure also 734 | # VERBATIM_HEADERS is set to NO. 735 | 736 | SOURCE_BROWSER = NO 737 | 738 | # Setting the INLINE_SOURCES tag to YES will include the body 739 | # of functions and classes directly in the documentation. 740 | 741 | INLINE_SOURCES = NO 742 | 743 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 744 | # doxygen to hide any special comment blocks from generated source code 745 | # fragments. Normal C and C++ comments will always remain visible. 746 | 747 | STRIP_CODE_COMMENTS = YES 748 | 749 | # If the REFERENCED_BY_RELATION tag is set to YES 750 | # then for each documented function all documented 751 | # functions referencing it will be listed. 752 | 753 | REFERENCED_BY_RELATION = NO 754 | 755 | # If the REFERENCES_RELATION tag is set to YES 756 | # then for each documented function all documented entities 757 | # called/used by that function will be listed. 758 | 759 | REFERENCES_RELATION = NO 760 | 761 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 762 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 763 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 764 | # link to the source code. Otherwise they will link to the documentation. 765 | 766 | REFERENCES_LINK_SOURCE = YES 767 | 768 | # If the USE_HTAGS tag is set to YES then the references to source code 769 | # will point to the HTML generated by the htags(1) tool instead of doxygen 770 | # built-in source browser. The htags tool is part of GNU's global source 771 | # tagging system (see http://www.gnu.org/software/global/global.html). You 772 | # will need version 4.8.6 or higher. 773 | 774 | USE_HTAGS = NO 775 | 776 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 777 | # will generate a verbatim copy of the header file for each class for 778 | # which an include is specified. Set to NO to disable this. 779 | 780 | VERBATIM_HEADERS = YES 781 | 782 | #--------------------------------------------------------------------------- 783 | # configuration options related to the alphabetical class index 784 | #--------------------------------------------------------------------------- 785 | 786 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 787 | # of all compounds will be generated. Enable this if the project 788 | # contains a lot of classes, structs, unions or interfaces. 789 | 790 | ALPHABETICAL_INDEX = NO 791 | 792 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 793 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 794 | # in which this list will be split (can be a number in the range [1..20]) 795 | 796 | COLS_IN_ALPHA_INDEX = 5 797 | 798 | # In case all classes in a project start with a common prefix, all 799 | # classes will be put under the same header in the alphabetical index. 800 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 801 | # should be ignored while generating the index headers. 802 | 803 | IGNORE_PREFIX = 804 | 805 | #--------------------------------------------------------------------------- 806 | # configuration options related to the HTML output 807 | #--------------------------------------------------------------------------- 808 | 809 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 810 | # generate HTML output. 811 | 812 | GENERATE_HTML = YES 813 | 814 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 815 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 816 | # put in front of it. If left blank `html' will be used as the default path. 817 | 818 | HTML_OUTPUT = html 819 | 820 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 821 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 822 | # doxygen will generate files with .html extension. 823 | 824 | HTML_FILE_EXTENSION = .html 825 | 826 | # The HTML_HEADER tag can be used to specify a personal HTML header for 827 | # each generated HTML page. If it is left blank doxygen will generate a 828 | # standard header. 829 | 830 | HTML_HEADER = 831 | 832 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for 833 | # each generated HTML page. If it is left blank doxygen will generate a 834 | # standard footer. 835 | 836 | HTML_FOOTER = 837 | 838 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 839 | # style sheet that is used by each HTML page. It can be used to 840 | # fine-tune the look of the HTML output. If the tag is left blank doxygen 841 | # will generate a default style sheet. Note that doxygen will try to copy 842 | # the style sheet file to the HTML output directory, so don't put your own 843 | # stylesheet in the HTML output directory as well, or it will be erased! 844 | 845 | HTML_STYLESHEET = 846 | 847 | # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 848 | # page will contain the date and time when the page was generated. Setting 849 | # this to NO can help when comparing the output of multiple runs. 850 | 851 | HTML_TIMESTAMP = YES 852 | 853 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 854 | # files or namespaces will be aligned in HTML using tables. If set to 855 | # NO a bullet list will be used. 856 | 857 | HTML_ALIGN_MEMBERS = YES 858 | 859 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 860 | # documentation will contain sections that can be hidden and shown after the 861 | # page has loaded. For this to work a browser that supports 862 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 863 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 864 | 865 | HTML_DYNAMIC_SECTIONS = NO 866 | 867 | # If the GENERATE_DOCSET tag is set to YES, additional index files 868 | # will be generated that can be used as input for Apple's Xcode 3 869 | # integrated development environment, introduced with OSX 10.5 (Leopard). 870 | # To create a documentation set, doxygen will generate a Makefile in the 871 | # HTML output directory. Running make will produce the docset in that 872 | # directory and running "make install" will install the docset in 873 | # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 874 | # it at startup. 875 | # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. 876 | 877 | GENERATE_DOCSET = YES 878 | 879 | # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 880 | # feed. A documentation feed provides an umbrella under which multiple 881 | # documentation sets from a single provider (such as a company or product suite) 882 | # can be grouped. 883 | 884 | DOCSET_FEEDNAME = "BayesianKit API Documentation" 885 | 886 | # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 887 | # should uniquely identify the documentation set bundle. This should be a 888 | # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 889 | # will append .docset to the name. 890 | 891 | DOCSET_BUNDLE_ID = net.ᐱ.BayesianKit 892 | 893 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files 894 | # will be generated that can be used as input for tools like the 895 | # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 896 | # of the generated HTML documentation. 897 | 898 | GENERATE_HTMLHELP = NO 899 | 900 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 901 | # be used to specify the file name of the resulting .chm file. You 902 | # can add a path in front of the file if the result should not be 903 | # written to the html output directory. 904 | 905 | CHM_FILE = 906 | 907 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 908 | # be used to specify the location (absolute path including file name) of 909 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 910 | # the HTML help compiler on the generated index.hhp. 911 | 912 | HHC_LOCATION = 913 | 914 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 915 | # controls if a separate .chi index file is generated (YES) or that 916 | # it should be included in the master .chm file (NO). 917 | 918 | GENERATE_CHI = NO 919 | 920 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 921 | # is used to encode HtmlHelp index (hhk), content (hhc) and project file 922 | # content. 923 | 924 | CHM_INDEX_ENCODING = 925 | 926 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 927 | # controls whether a binary table of contents is generated (YES) or a 928 | # normal table of contents (NO) in the .chm file. 929 | 930 | BINARY_TOC = NO 931 | 932 | # The TOC_EXPAND flag can be set to YES to add extra items for group members 933 | # to the contents of the HTML help documentation and to the tree view. 934 | 935 | TOC_EXPAND = NO 936 | 937 | # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER 938 | # are set, an additional index file will be generated that can be used as input for 939 | # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated 940 | # HTML documentation. 941 | 942 | GENERATE_QHP = NO 943 | 944 | # If the QHG_LOCATION tag is specified, the QCH_FILE tag can 945 | # be used to specify the file name of the resulting .qch file. 946 | # The path specified is relative to the HTML output folder. 947 | 948 | QCH_FILE = 949 | 950 | # The QHP_NAMESPACE tag specifies the namespace to use when generating 951 | # Qt Help Project output. For more information please see 952 | # http://doc.trolltech.com/qthelpproject.html#namespace 953 | 954 | QHP_NAMESPACE = org.doxygen.Project 955 | 956 | # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 957 | # Qt Help Project output. For more information please see 958 | # http://doc.trolltech.com/qthelpproject.html#virtual-folders 959 | 960 | QHP_VIRTUAL_FOLDER = doc 961 | 962 | # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. 963 | # For more information please see 964 | # http://doc.trolltech.com/qthelpproject.html#custom-filters 965 | 966 | QHP_CUST_FILTER_NAME = 967 | 968 | # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see 969 | # Qt Help Project / Custom Filters. 970 | 971 | QHP_CUST_FILTER_ATTRS = 972 | 973 | # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's 974 | # filter section matches. 975 | # Qt Help Project / Filter Attributes. 976 | 977 | QHP_SECT_FILTER_ATTRS = 978 | 979 | # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 980 | # be used to specify the location of Qt's qhelpgenerator. 981 | # If non-empty doxygen will try to run qhelpgenerator on the generated 982 | # .qhp file. 983 | 984 | QHG_LOCATION = 985 | 986 | # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files 987 | # will be generated, which together with the HTML files, form an Eclipse help 988 | # plugin. To install this plugin and make it available under the help contents 989 | # menu in Eclipse, the contents of the directory containing the HTML and XML 990 | # files needs to be copied into the plugins directory of eclipse. The name of 991 | # the directory within the plugins directory should be the same as 992 | # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 993 | # the help appears. 994 | 995 | GENERATE_ECLIPSEHELP = NO 996 | 997 | # A unique identifier for the eclipse help plugin. When installing the plugin 998 | # the directory name containing the HTML and XML files should also have 999 | # this name. 1000 | 1001 | ECLIPSE_DOC_ID = org.doxygen.Project 1002 | 1003 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 1004 | # top of each HTML page. The value NO (the default) enables the index and 1005 | # the value YES disables it. 1006 | 1007 | DISABLE_INDEX = NO 1008 | 1009 | # This tag can be used to set the number of enum values (range [1..20]) 1010 | # that doxygen will group on one line in the generated HTML documentation. 1011 | 1012 | ENUM_VALUES_PER_LINE = 4 1013 | 1014 | # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 1015 | # structure should be generated to display hierarchical information. 1016 | # If the tag value is set to YES, a side panel will be generated 1017 | # containing a tree-like index structure (just like the one that 1018 | # is generated for HTML Help). For this to work a browser that supports 1019 | # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 1020 | # Windows users are probably better off using the HTML help feature. 1021 | 1022 | GENERATE_TREEVIEW = NO 1023 | 1024 | # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 1025 | # and Class Hierarchy pages using a tree view instead of an ordered list. 1026 | 1027 | USE_INLINE_TREES = NO 1028 | 1029 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 1030 | # used to set the initial width (in pixels) of the frame in which the tree 1031 | # is shown. 1032 | 1033 | TREEVIEW_WIDTH = 250 1034 | 1035 | # Use this tag to change the font size of Latex formulas included 1036 | # as images in the HTML documentation. The default is 10. Note that 1037 | # when you change the font size after a successful doxygen run you need 1038 | # to manually remove any form_*.png images from the HTML output directory 1039 | # to force them to be regenerated. 1040 | 1041 | FORMULA_FONTSIZE = 10 1042 | 1043 | # When the SEARCHENGINE tag is enabled doxygen will generate a search box 1044 | # for the HTML output. The underlying search engine uses javascript 1045 | # and DHTML and should work on any modern browser. Note that when using 1046 | # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 1047 | # (GENERATE_DOCSET) there is already a search function so this one should 1048 | # typically be disabled. For large projects the javascript based search engine 1049 | # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. 1050 | 1051 | SEARCHENGINE = YES 1052 | 1053 | # When the SERVER_BASED_SEARCH tag is enabled the search engine will be 1054 | # implemented using a PHP enabled web server instead of at the web client 1055 | # using Javascript. Doxygen will generate the search PHP script and index 1056 | # file to put on the web server. The advantage of the server 1057 | # based approach is that it scales better to large projects and allows 1058 | # full text search. The disadvances is that it is more difficult to setup 1059 | # and does not have live searching capabilities. 1060 | 1061 | SERVER_BASED_SEARCH = NO 1062 | 1063 | #--------------------------------------------------------------------------- 1064 | # configuration options related to the LaTeX output 1065 | #--------------------------------------------------------------------------- 1066 | 1067 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 1068 | # generate Latex output. 1069 | 1070 | GENERATE_LATEX = NO 1071 | 1072 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 1073 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1074 | # put in front of it. If left blank `latex' will be used as the default path. 1075 | 1076 | LATEX_OUTPUT = latex 1077 | 1078 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 1079 | # invoked. If left blank `latex' will be used as the default command name. 1080 | # Note that when enabling USE_PDFLATEX this option is only used for 1081 | # generating bitmaps for formulas in the HTML output, but not in the 1082 | # Makefile that is written to the output directory. 1083 | 1084 | LATEX_CMD_NAME = latex 1085 | 1086 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 1087 | # generate index for LaTeX. If left blank `makeindex' will be used as the 1088 | # default command name. 1089 | 1090 | MAKEINDEX_CMD_NAME = makeindex 1091 | 1092 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 1093 | # LaTeX documents. This may be useful for small projects and may help to 1094 | # save some trees in general. 1095 | 1096 | COMPACT_LATEX = NO 1097 | 1098 | # The PAPER_TYPE tag can be used to set the paper type that is used 1099 | # by the printer. Possible values are: a4, a4wide, letter, legal and 1100 | # executive. If left blank a4wide will be used. 1101 | 1102 | PAPER_TYPE = a4wide 1103 | 1104 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 1105 | # packages that should be included in the LaTeX output. 1106 | 1107 | EXTRA_PACKAGES = 1108 | 1109 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 1110 | # the generated latex document. The header should contain everything until 1111 | # the first chapter. If it is left blank doxygen will generate a 1112 | # standard header. Notice: only use this tag if you know what you are doing! 1113 | 1114 | LATEX_HEADER = 1115 | 1116 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 1117 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will 1118 | # contain links (just like the HTML output) instead of page references 1119 | # This makes the output suitable for online browsing using a pdf viewer. 1120 | 1121 | PDF_HYPERLINKS = YES 1122 | 1123 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 1124 | # plain latex in the generated Makefile. Set this option to YES to get a 1125 | # higher quality PDF documentation. 1126 | 1127 | USE_PDFLATEX = YES 1128 | 1129 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 1130 | # command to the generated LaTeX files. This will instruct LaTeX to keep 1131 | # running if errors occur, instead of asking the user for help. 1132 | # This option is also used when generating formulas in HTML. 1133 | 1134 | LATEX_BATCHMODE = NO 1135 | 1136 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not 1137 | # include the index chapters (such as File Index, Compound Index, etc.) 1138 | # in the output. 1139 | 1140 | LATEX_HIDE_INDICES = NO 1141 | 1142 | # If LATEX_SOURCE_CODE is set to YES then doxygen will include 1143 | # source code with syntax highlighting in the LaTeX output. 1144 | # Note that which sources are shown also depends on other settings 1145 | # such as SOURCE_BROWSER. 1146 | 1147 | LATEX_SOURCE_CODE = NO 1148 | 1149 | #--------------------------------------------------------------------------- 1150 | # configuration options related to the RTF output 1151 | #--------------------------------------------------------------------------- 1152 | 1153 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 1154 | # The RTF output is optimized for Word 97 and may not look very pretty with 1155 | # other RTF readers or editors. 1156 | 1157 | GENERATE_RTF = NO 1158 | 1159 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 1160 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1161 | # put in front of it. If left blank `rtf' will be used as the default path. 1162 | 1163 | RTF_OUTPUT = rtf 1164 | 1165 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 1166 | # RTF documents. This may be useful for small projects and may help to 1167 | # save some trees in general. 1168 | 1169 | COMPACT_RTF = NO 1170 | 1171 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 1172 | # will contain hyperlink fields. The RTF file will 1173 | # contain links (just like the HTML output) instead of page references. 1174 | # This makes the output suitable for online browsing using WORD or other 1175 | # programs which support those fields. 1176 | # Note: wordpad (write) and others do not support links. 1177 | 1178 | RTF_HYPERLINKS = NO 1179 | 1180 | # Load stylesheet definitions from file. Syntax is similar to doxygen's 1181 | # config file, i.e. a series of assignments. You only have to provide 1182 | # replacements, missing definitions are set to their default value. 1183 | 1184 | RTF_STYLESHEET_FILE = 1185 | 1186 | # Set optional variables used in the generation of an rtf document. 1187 | # Syntax is similar to doxygen's config file. 1188 | 1189 | RTF_EXTENSIONS_FILE = 1190 | 1191 | #--------------------------------------------------------------------------- 1192 | # configuration options related to the man page output 1193 | #--------------------------------------------------------------------------- 1194 | 1195 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 1196 | # generate man pages 1197 | 1198 | GENERATE_MAN = NO 1199 | 1200 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. 1201 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1202 | # put in front of it. If left blank `man' will be used as the default path. 1203 | 1204 | MAN_OUTPUT = man 1205 | 1206 | # The MAN_EXTENSION tag determines the extension that is added to 1207 | # the generated man pages (default is the subroutine's section .3) 1208 | 1209 | MAN_EXTENSION = .3 1210 | 1211 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 1212 | # then it will generate one additional man file for each entity 1213 | # documented in the real man page(s). These additional files 1214 | # only source the real man page, but without them the man command 1215 | # would be unable to find the correct page. The default is NO. 1216 | 1217 | MAN_LINKS = NO 1218 | 1219 | #--------------------------------------------------------------------------- 1220 | # configuration options related to the XML output 1221 | #--------------------------------------------------------------------------- 1222 | 1223 | # If the GENERATE_XML tag is set to YES Doxygen will 1224 | # generate an XML file that captures the structure of 1225 | # the code including all documentation. 1226 | 1227 | GENERATE_XML = YES 1228 | 1229 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. 1230 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 1231 | # put in front of it. If left blank `xml' will be used as the default path. 1232 | 1233 | XML_OUTPUT = xml 1234 | 1235 | # The XML_SCHEMA tag can be used to specify an XML schema, 1236 | # which can be used by a validating XML parser to check the 1237 | # syntax of the XML files. 1238 | 1239 | XML_SCHEMA = 1240 | 1241 | # The XML_DTD tag can be used to specify an XML DTD, 1242 | # which can be used by a validating XML parser to check the 1243 | # syntax of the XML files. 1244 | 1245 | XML_DTD = 1246 | 1247 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 1248 | # dump the program listings (including syntax highlighting 1249 | # and cross-referencing information) to the XML output. Note that 1250 | # enabling this will significantly increase the size of the XML output. 1251 | 1252 | XML_PROGRAMLISTING = YES 1253 | 1254 | #--------------------------------------------------------------------------- 1255 | # configuration options for the AutoGen Definitions output 1256 | #--------------------------------------------------------------------------- 1257 | 1258 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 1259 | # generate an AutoGen Definitions (see autogen.sf.net) file 1260 | # that captures the structure of the code including all 1261 | # documentation. Note that this feature is still experimental 1262 | # and incomplete at the moment. 1263 | 1264 | GENERATE_AUTOGEN_DEF = NO 1265 | 1266 | #--------------------------------------------------------------------------- 1267 | # configuration options related to the Perl module output 1268 | #--------------------------------------------------------------------------- 1269 | 1270 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will 1271 | # generate a Perl module file that captures the structure of 1272 | # the code including all documentation. Note that this 1273 | # feature is still experimental and incomplete at the 1274 | # moment. 1275 | 1276 | GENERATE_PERLMOD = NO 1277 | 1278 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 1279 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able 1280 | # to generate PDF and DVI output from the Perl module output. 1281 | 1282 | PERLMOD_LATEX = NO 1283 | 1284 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 1285 | # nicely formatted so it can be parsed by a human reader. This is useful 1286 | # if you want to understand what is going on. On the other hand, if this 1287 | # tag is set to NO the size of the Perl module output will be much smaller 1288 | # and Perl will parse it just the same. 1289 | 1290 | PERLMOD_PRETTY = YES 1291 | 1292 | # The names of the make variables in the generated doxyrules.make file 1293 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1294 | # This is useful so different doxyrules.make files included by the same 1295 | # Makefile don't overwrite each other's variables. 1296 | 1297 | PERLMOD_MAKEVAR_PREFIX = 1298 | 1299 | #--------------------------------------------------------------------------- 1300 | # Configuration options related to the preprocessor 1301 | #--------------------------------------------------------------------------- 1302 | 1303 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1304 | # evaluate all C-preprocessor directives found in the sources and include 1305 | # files. 1306 | 1307 | ENABLE_PREPROCESSING = YES 1308 | 1309 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1310 | # names in the source code. If set to NO (the default) only conditional 1311 | # compilation will be performed. Macro expansion can be done in a controlled 1312 | # way by setting EXPAND_ONLY_PREDEF to YES. 1313 | 1314 | MACRO_EXPANSION = NO 1315 | 1316 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1317 | # then the macro expansion is limited to the macros specified with the 1318 | # PREDEFINED and EXPAND_AS_DEFINED tags. 1319 | 1320 | EXPAND_ONLY_PREDEF = NO 1321 | 1322 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1323 | # in the INCLUDE_PATH (see below) will be search if a #include is found. 1324 | 1325 | SEARCH_INCLUDES = YES 1326 | 1327 | # The INCLUDE_PATH tag can be used to specify one or more directories that 1328 | # contain include files that are not input files but should be processed by 1329 | # the preprocessor. 1330 | 1331 | INCLUDE_PATH = 1332 | 1333 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1334 | # patterns (like *.h and *.hpp) to filter out the header-files in the 1335 | # directories. If left blank, the patterns specified with FILE_PATTERNS will 1336 | # be used. 1337 | 1338 | INCLUDE_FILE_PATTERNS = 1339 | 1340 | # The PREDEFINED tag can be used to specify one or more macro names that 1341 | # are defined before the preprocessor is started (similar to the -D option of 1342 | # gcc). The argument of the tag is a list of macros of the form: name 1343 | # or name=definition (no spaces). If the definition and the = are 1344 | # omitted =1 is assumed. To prevent a macro definition from being 1345 | # undefined via #undef or recursively expanded use the := operator 1346 | # instead of the = operator. 1347 | 1348 | PREDEFINED = 1349 | 1350 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1351 | # this tag can be used to specify a list of macro names that should be expanded. 1352 | # The macro definition that is found in the sources will be used. 1353 | # Use the PREDEFINED tag if you want to use a different macro definition. 1354 | 1355 | EXPAND_AS_DEFINED = 1356 | 1357 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1358 | # doxygen's preprocessor will remove all function-like macros that are alone 1359 | # on a line, have an all uppercase name, and do not end with a semicolon. Such 1360 | # function macros are typically used for boiler-plate code, and will confuse 1361 | # the parser if not removed. 1362 | 1363 | SKIP_FUNCTION_MACROS = YES 1364 | 1365 | #--------------------------------------------------------------------------- 1366 | # Configuration::additions related to external references 1367 | #--------------------------------------------------------------------------- 1368 | 1369 | # The TAGFILES option can be used to specify one or more tagfiles. 1370 | # Optionally an initial location of the external documentation 1371 | # can be added for each tagfile. The format of a tag file without 1372 | # this location is as follows: 1373 | # TAGFILES = file1 file2 ... 1374 | # Adding location for the tag files is done as follows: 1375 | # TAGFILES = file1=loc1 "file2 = loc2" ... 1376 | # where "loc1" and "loc2" can be relative or absolute paths or 1377 | # URLs. If a location is present for each tag, the installdox tool 1378 | # does not have to be run to correct the links. 1379 | # Note that each tag file must have a unique name 1380 | # (where the name does NOT include the path) 1381 | # If a tag file is not located in the directory in which doxygen 1382 | # is run, you must also specify the path to the tagfile here. 1383 | 1384 | TAGFILES = 1385 | 1386 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1387 | # a tag file that is based on the input files it reads. 1388 | 1389 | GENERATE_TAGFILE = 1390 | 1391 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1392 | # in the class index. If set to NO only the inherited external classes 1393 | # will be listed. 1394 | 1395 | ALLEXTERNALS = NO 1396 | 1397 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1398 | # in the modules index. If set to NO, only the current project's groups will 1399 | # be listed. 1400 | 1401 | EXTERNAL_GROUPS = YES 1402 | 1403 | # The PERL_PATH should be the absolute path and name of the perl script 1404 | # interpreter (i.e. the result of `which perl'). 1405 | 1406 | PERL_PATH = /usr/bin/perl 1407 | 1408 | #--------------------------------------------------------------------------- 1409 | # Configuration options related to the dot tool 1410 | #--------------------------------------------------------------------------- 1411 | 1412 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1413 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1414 | # or super classes. Setting the tag to NO turns the diagrams off. Note that 1415 | # this option is superseded by the HAVE_DOT option below. This is only a 1416 | # fallback. It is recommended to install and use dot, since it yields more 1417 | # powerful graphs. 1418 | 1419 | CLASS_DIAGRAMS = YES 1420 | 1421 | # You can define message sequence charts within doxygen comments using the \msc 1422 | # command. Doxygen will then run the mscgen tool (see 1423 | # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 1424 | # documentation. The MSCGEN_PATH tag allows you to specify the directory where 1425 | # the mscgen tool resides. If left empty the tool is assumed to be found in the 1426 | # default search path. 1427 | 1428 | MSCGEN_PATH = 1429 | 1430 | # If set to YES, the inheritance and collaboration graphs will hide 1431 | # inheritance and usage relations if the target is undocumented 1432 | # or is not a class. 1433 | 1434 | HIDE_UNDOC_RELATIONS = YES 1435 | 1436 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1437 | # available from the path. This tool is part of Graphviz, a graph visualization 1438 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1439 | # have no effect if this option is set to NO (the default) 1440 | 1441 | HAVE_DOT = NO 1442 | 1443 | # By default doxygen will write a font called FreeSans.ttf to the output 1444 | # directory and reference it in all dot files that doxygen generates. This 1445 | # font does not include all possible unicode characters however, so when you need 1446 | # these (or just want a differently looking font) you can specify the font name 1447 | # using DOT_FONTNAME. You need need to make sure dot is able to find the font, 1448 | # which can be done by putting it in a standard location or by setting the 1449 | # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 1450 | # containing the font. 1451 | 1452 | DOT_FONTNAME = FreeSans 1453 | 1454 | # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 1455 | # The default size is 10pt. 1456 | 1457 | DOT_FONTSIZE = 10 1458 | 1459 | # By default doxygen will tell dot to use the output directory to look for the 1460 | # FreeSans.ttf font (which doxygen will put there itself). If you specify a 1461 | # different font using DOT_FONTNAME you can set the path where dot 1462 | # can find it using this tag. 1463 | 1464 | DOT_FONTPATH = 1465 | 1466 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1467 | # will generate a graph for each documented class showing the direct and 1468 | # indirect inheritance relations. Setting this tag to YES will force the 1469 | # the CLASS_DIAGRAMS tag to NO. 1470 | 1471 | CLASS_GRAPH = YES 1472 | 1473 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1474 | # will generate a graph for each documented class showing the direct and 1475 | # indirect implementation dependencies (inheritance, containment, and 1476 | # class references variables) of the class with other documented classes. 1477 | 1478 | COLLABORATION_GRAPH = YES 1479 | 1480 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1481 | # will generate a graph for groups, showing the direct groups dependencies 1482 | 1483 | GROUP_GRAPHS = YES 1484 | 1485 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1486 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 1487 | # Language. 1488 | 1489 | UML_LOOK = NO 1490 | 1491 | # If set to YES, the inheritance and collaboration graphs will show the 1492 | # relations between templates and their instances. 1493 | 1494 | TEMPLATE_RELATIONS = NO 1495 | 1496 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1497 | # tags are set to YES then doxygen will generate a graph for each documented 1498 | # file showing the direct and indirect include dependencies of the file with 1499 | # other documented files. 1500 | 1501 | INCLUDE_GRAPH = YES 1502 | 1503 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1504 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1505 | # documented header file showing the documented files that directly or 1506 | # indirectly include this file. 1507 | 1508 | INCLUDED_BY_GRAPH = YES 1509 | 1510 | # If the CALL_GRAPH and HAVE_DOT options are set to YES then 1511 | # doxygen will generate a call dependency graph for every global function 1512 | # or class method. Note that enabling this option will significantly increase 1513 | # the time of a run. So in most cases it will be better to enable call graphs 1514 | # for selected functions only using the \callgraph command. 1515 | 1516 | CALL_GRAPH = NO 1517 | 1518 | # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 1519 | # doxygen will generate a caller dependency graph for every global function 1520 | # or class method. Note that enabling this option will significantly increase 1521 | # the time of a run. So in most cases it will be better to enable caller 1522 | # graphs for selected functions only using the \callergraph command. 1523 | 1524 | CALLER_GRAPH = NO 1525 | 1526 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1527 | # will graphical hierarchy of all classes instead of a textual one. 1528 | 1529 | GRAPHICAL_HIERARCHY = YES 1530 | 1531 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1532 | # then doxygen will show the dependencies a directory has on other directories 1533 | # in a graphical way. The dependency relations are determined by the #include 1534 | # relations between the files in the directories. 1535 | 1536 | DIRECTORY_GRAPH = YES 1537 | 1538 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1539 | # generated by dot. Possible values are png, jpg, or gif 1540 | # If left blank png will be used. 1541 | 1542 | DOT_IMAGE_FORMAT = png 1543 | 1544 | # The tag DOT_PATH can be used to specify the path where the dot tool can be 1545 | # found. If left blank, it is assumed the dot tool can be found in the path. 1546 | 1547 | DOT_PATH = 1548 | 1549 | # The DOTFILE_DIRS tag can be used to specify one or more directories that 1550 | # contain dot files that are included in the documentation (see the 1551 | # \dotfile command). 1552 | 1553 | DOTFILE_DIRS = 1554 | 1555 | # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1556 | # nodes that will be shown in the graph. If the number of nodes in a graph 1557 | # becomes larger than this value, doxygen will truncate the graph, which is 1558 | # visualized by representing a node as a red box. Note that doxygen if the 1559 | # number of direct children of the root node in a graph is already larger than 1560 | # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 1561 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 1562 | 1563 | DOT_GRAPH_MAX_NODES = 50 1564 | 1565 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1566 | # graphs generated by dot. A depth value of 3 means that only nodes reachable 1567 | # from the root by following a path via at most 3 edges will be shown. Nodes 1568 | # that lay further from the root node will be omitted. Note that setting this 1569 | # option to 1 or 2 may greatly reduce the computation time needed for large 1570 | # code bases. Also note that the size of a graph can be further restricted by 1571 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 1572 | 1573 | MAX_DOT_GRAPH_DEPTH = 0 1574 | 1575 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1576 | # background. This is disabled by default, because dot on Windows does not 1577 | # seem to support this out of the box. Warning: Depending on the platform used, 1578 | # enabling this option may lead to badly anti-aliased labels on the edges of 1579 | # a graph (i.e. they become hard to read). 1580 | 1581 | DOT_TRANSPARENT = NO 1582 | 1583 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1584 | # files in one run (i.e. multiple -o and -T options on the command line). This 1585 | # makes dot run faster, but since only newer versions of dot (>1.8.10) 1586 | # support this, this feature is disabled by default. 1587 | 1588 | DOT_MULTI_TARGETS = NO 1589 | 1590 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1591 | # generate a legend page explaining the meaning of the various boxes and 1592 | # arrows in the dot generated graphs. 1593 | 1594 | GENERATE_LEGEND = YES 1595 | 1596 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1597 | # remove the intermediate dot files that are used to generate 1598 | # the various graphs. 1599 | 1600 | DOT_CLEANUP = YES 1601 | -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | net.ᐱ.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | L0K_ 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Samuel Mendes 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | * Neither the name of ᐱ nor the names of its 16 | contributors may be used to endorse or promote products derived 17 | from this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 25 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | BayesianKit - Cocoa Objective-C Framework for a naive bayesian classifier 2 | ========================================================================= 3 | 4 | BayesianKit is a Mac OS X Framework written by Samuel Mendes in Objective-C 2.0 5 | and released under BSD 3-clauses license. BayesianKit offers a simple, ready to 6 | use, implementation for a bayesian classifier. A command line utility is also 7 | provided. 8 | 9 | Dependencies 10 | ------------ 11 | 12 | * [ParseKit](http://parsekit.com) used for the default tokenizer 13 | * [appledoc](http://www.gentlebytes.com/freeware/appledoc) used to generate the 14 | headers' documentation 15 | 16 | Both of them are included as submodules. After having cloned the repository 17 | type: 18 | 19 | git submodule init 20 | git submodule update 21 | 22 | However appledoc needs [Doxygen](http://www.stack.nl/~dimitri/doxygen) which is 23 | not provided. 24 | 25 | Xcode Project 26 | ------------- 27 | 28 | The BayesianKit project consists of 3 targets: 29 | 30 | - **BayesianKit** : The BayesianKit framework. 31 | - **Bayes** : The command line utility. 32 | - **Install Documentation** : The script running appledoc. 33 | 34 | BayesianKit usage 35 | ----------------- 36 | 37 | The default classifier comes with a tokenizer based on ParseKit. Quite efficient 38 | when training on source code. It also implements and use the Robinson-Fisher 39 | combiner on probabilities. Both the tokenizer and combiner can be changed, 40 | however note that they are not saved along the training. Hence if you load a 41 | classifier from a file, you must reset the tokenizer and/or combiner. 42 | 43 | ### Creating and Training a new classifier ### 44 | 45 | BKClassifier *classifier = [[BKClassifier alloc] init]; 46 | [classifier trainWithString:@"one two three four five" 47 | forPoolNamed:@"english"]; 48 | [classifier trainWithString:@"un deux trois quatre cinq" 49 | forPoolNamed:@"french"]; 50 | 51 | ### Saving and reloading the training data ### 52 | 53 | [classifier writeToFile:@"counting.bks"] 54 | // Another day, in a different process 55 | BKClassifier *anotherOne; 56 | anotherOne = [BKClassifier classifierWithContentsOfFile:@"counting.bks"]; 57 | 58 | ### Using the classifier to make a guess ### 59 | 60 | NSDictionary *results = [anotherOne guessWithString:@"three platypuses"]; 61 | NSLog(@"%@", results); 62 | 63 | The output is: 64 | 65 | $ { 66 | english = "0.9999"; 67 | } 68 | 69 | Bayes 70 | ----- 71 | 72 | This tool was intended to test quickly the classifier, and works only with 73 | files. A manpage is also provided with every details. 74 | 75 | ### Installation ### 76 | 77 | From the root directory of the project: 78 | 79 | sudo cp build/Release/bayes /usr/local/bin/ 80 | sudo cp docs/man/man1/bayes.1 /usr/local/share/man/man1/ 81 | 82 | ### Training with a save file ### 83 | 84 | bayes -f save.bks -s -t english shakespeare.txt -t french moliere.txt 85 | 86 | ### Guessing based on this training ### 87 | 88 | bayes -f save.bks -g mystery.txt 89 | 90 | 91 | LICENSE 92 | ======= 93 | 94 | Copyright (c) 2010, Samuel Mendes 95 | 96 | All rights reserved. 97 | 98 | Redistribution and use in source and binary forms, with or without 99 | modification, are permitted provided that the following conditions are met: 100 | 101 | * Redistributions of source code must retain the above copyright 102 | notice, this list of conditions and the following disclaimer. 103 | 104 | * Redistributions in binary form must reproduce the above copyright 105 | notice, this list of conditions and the following disclaimer in the 106 | documentation and/or other materials provided with the distribution. 107 | 108 | * Neither the name of ᐱ nor the names of its 109 | contributors may be used to endorse or promote products derived 110 | from this software without specific prior written permission. 111 | 112 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 113 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 114 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 115 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 116 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 117 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 118 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 119 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 120 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 121 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 122 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 123 | 124 | Samuel Mendes 125 | -------------------------------------------------------------------------------- /docs/man/man1/bayes.1: -------------------------------------------------------------------------------- 1 | .\" 2 | .\" Copyright (c) 2010, Samuel Mendes 3 | .\" 4 | .\" All rights reserved. 5 | .\" 6 | .\" Redistribution and use in source and binary forms, with or without 7 | .\" modification, are permitted provided that the following conditions are met: 8 | .\" 9 | .\" * Redistributions of source code must retain the above copyright 10 | .\" notice, this list of conditions and the following disclaimer. 11 | .\" 12 | .\" * Redistributions in binary form must reproduce the above copyright 13 | .\" notice, this list of conditions and the following disclaimer in the 14 | .\" documentation and/or other materials provided with the distribution. 15 | .\" 16 | .\" * Neither the name of ᐱ nor the names of its 17 | .\" contributors may be used to endorse or promote products derived 18 | .\" from this software without specific prior written permission. 19 | .\" 20 | .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | .\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | .\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | .\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 26 | .\" TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 27 | .\" PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 28 | .\" LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 29 | .\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | .\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | .\" 32 | .Dd April 15, 2010 33 | .Dt BAYES 1 34 | .Os 35 | .Sh NAME 36 | .Nm bayes 37 | .Nd bayes command execution 38 | .Sh SYNOPSIS 39 | .Nm 40 | .Op Fl vh 41 | .Op Fl sf 42 | .Op Fl tgrd 43 | .Sh DESCRIPTION 44 | The 45 | .Nm 46 | utility provides a simple bayesian classifier . 47 | .Pp 48 | Available options: 49 | .Bl -tag -width Ds 50 | .It Fl v Fl Fl version 51 | Display the actual version number. 52 | .It Fl f Fl Fl file Ar path 53 | Save/Load classifier training to/from a file. 54 | .It Fl s Fl Fl save 55 | Save the changes in -f file before exiting. 56 | .It Fl t Fl Fl train Ar cat Ar path 57 | Uses path as training data for a category. 58 | .It Fl g Fl Fl guess Ar path 59 | Guess to which category path is belonging. 60 | .It Fl r Fl Fl strip Ar level 61 | Remove any token with a total count lower than level. 62 | .It Fl d Fl Fl dump 63 | Print out the whole content of the classifier. 64 | .El 65 | .Sh EXIT STATUS 66 | .Ex -std 67 | .Sh EXAMPLES 68 | The following train a classifier to learn 69 | .Ar english 70 | on 71 | .Ar shakespeare.txt 72 | and saves it in 73 | .Ar classifier.bks . 74 | .Dl Nm Fl f Pa classifier.bks Fl s Fl t Pa english Pa shakespeare.txt 75 | .Pp 76 | We can reuse the previous training as long as we keep 77 | .Ar classifier.bks . 78 | To train it some more: 79 | .Dl Nm Fl f Pa classifier.bks Fl s Fl t Pa french Pa moliere.txt 80 | .Pp 81 | To ask the classifier to which language belongs 82 | .Ar mystery.txt : 83 | .Dl Nm Fl f Pa classifier.bks Fl g Pa mystery.txt 84 | .Pp 85 | Wildcards can also be used: 86 | .Dl Nm Fl f Pa classifier.bks Fl g Pa mysteries* 87 | .Pp 88 | To try a guess with a modified training, but without overwritting 89 | .Ar classifier.bks : 90 | .Dl Nm Fl f Pa classifier.bks Fl t Pa italian Pa dante.txt Fl g Pa mystery.txt 91 | .Pp 92 | The options 93 | .Ar file 94 | and 95 | .Ar save 96 | are processed in priority and can be placed anywhere. 97 | Saving will only be done just before a sucessful exit. 98 | The options 99 | .Ar train , 100 | .Ar guess and 101 | .Ar strip 102 | are processed in order of appearance within the argument list. 103 | -------------------------------------------------------------------------------- /src/BKClassifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKBayesianClassifier.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | 40 | #import 41 | #import 42 | 43 | 44 | /** Implementation of a naive bayesian classifier. 45 | 46 | BKClassifier is provided with a default setup using Robinson-Fisher 47 | probabilities combiner and a ParseKit-based tokenizer. 48 | 49 | Using methods @c initWithContentsOfFile:() and @c writeToFile:() the 50 | classifier's training can be saved and reloaded. Note that if you change the 51 | probabilities combiner or the tokenizer, those changes are not saved in the 52 | file. You need to reapply thoses changes after reloading the classifier. 53 | 54 | To train the classifier use @c trainWithFile:forPoolNamed:() or 55 | @c trainWithString:forPoolNamed:(). At the end of those methods 56 | @c updatePoolsProbabilities() will be automatically called and probabilities 57 | associated to each tokens will be re-computed. 58 | 59 | Once trained the classifier can be immediatly used with @c guessWithFile:() or 60 | @c guessWithString:(). Both returns a dictionary containing the score, in 61 | percent for each pool. 62 | 63 | To avoid unecessary big pools, @c stripToLevel:() will remove any token with a 64 | total count lower than specified. 65 | */ 66 | @interface BKClassifier : NSObject { 67 | BKDataPool *corpus; 68 | 69 | NSMutableDictionary *pools; 70 | BOOL dirty; 71 | 72 | NSInvocation *probabilitiesCombinerInvocation; 73 | 74 | id tokenizer; 75 | } 76 | 77 | ////////////////////////////////////////////////////////////////////////////////////////// 78 | /// @name Properties 79 | ////////////////////////////////////////////////////////////////////////////////////////// 80 | 81 | /** Dictionary containing every data pools of the classifier */ 82 | @property (readonly) NSMutableDictionary *pools; 83 | 84 | /** Invocation to call for combining probabilities. 85 | 86 | As an alternative you can use @c setProbabilitiesCombinerWithTarget:selector:userInfo:(). 87 | 88 | By default it uses @c robinsonFisherCombinerOn:userInfo:. 89 | */ 90 | @property (readwrite, retain) NSInvocation *probabilitiesCombinerInvocation; 91 | 92 | /** Tokenizer to use on string training or guessing. 93 | 94 | By default it uses @c BKTokenizer 95 | */ 96 | @property (readwrite, retain) id tokenizer; 97 | 98 | 99 | ////////////////////////////////////////////////////////////////////////////////////////// 100 | /// @name Creating a classifier 101 | ////////////////////////////////////////////////////////////////////////////////////////// 102 | 103 | /** Create a new classifier using a previous training saved in a file. 104 | 105 | @param path The path to the file containing the classifier's save. 106 | @returns A new bayesian classifier. 107 | @see initWithContentsOfFile: 108 | */ 109 | - (BKClassifier*)classifierWithContentsOfFile:(NSString*)path; 110 | 111 | 112 | ////////////////////////////////////////////////////////////////////////////////////////// 113 | /// @name Initializing a classifier 114 | ////////////////////////////////////////////////////////////////////////////////////////// 115 | 116 | /** Initialize a bayesian classifier using a previous training saved in a file. 117 | 118 | @param path The path to the file containing the classifier's save. 119 | @returns A bayesian classifier initialized. 120 | @see classifierWithContentsOfFile: 121 | */ 122 | - (id)initWithContentsOfFile:(NSString*)path; 123 | 124 | 125 | ////////////////////////////////////////////////////////////////////////////////////////// 126 | /// @name Storing a classifier's training 127 | ////////////////////////////////////////////////////////////////////////////////////////// 128 | 129 | /** Saves all training data in a file. 130 | 131 | If path contains a tilde (~) character, you must expand it before invoking this method. 132 | @param path The path at which to write the file. 133 | @return YES if the file is written successfully, otherwise NO. 134 | */ 135 | - (BOOL)writeToFile:(NSString*)path; 136 | 137 | 138 | ////////////////////////////////////////////////////////////////////////////////////////// 139 | /// @name Creating & Destroying pools 140 | ////////////////////////////////////////////////////////////////////////////////////////// 141 | 142 | /** Returns the pool with a given name. 143 | 144 | If the classifier do not hold a pool with this name, a new one is created. 145 | @param poolName The name of the pool to look for. 146 | @return The pool associated to the name. 147 | */ 148 | - (BKDataPool*)poolNamed:(NSString*)poolName; 149 | 150 | /** Destroy a pool with a given name. 151 | 152 | @param poolName The name of the pool. 153 | */ 154 | - (void)removePoolNamed:(NSString*)poolName; 155 | 156 | 157 | ////////////////////////////////////////////////////////////////////////////////////////// 158 | /// @name Updating probabilities 159 | ////////////////////////////////////////////////////////////////////////////////////////// 160 | 161 | /** Compute the probability associated with every tokens in every pools. */ 162 | - (void)updatePoolsProbabilities; 163 | 164 | 165 | ////////////////////////////////////////////////////////////////////////////////////////// 166 | /// @name Probabilities combining 167 | ////////////////////////////////////////////////////////////////////////////////////////// 168 | 169 | /** Change the probabilities combiner. 170 | 171 | @param target The object to which to send the message specified by selector when 172 | the classifier needs to combine a series of probabilities. 173 | The target object is @b not retained by the classifier. 174 | @param selector The selector to send to the target when the classifier needs to 175 | combine a series of probabilities. The selector must have the same signature than 176 | @c robinsonCombinerOn:userInfo:(). The classifier passes an array 177 | of @c NSNumber containing float values in @a probabilities. 178 | @param userInfo Custom user info for the combiner. 179 | The object you specify is @b not retained by the classifier. 180 | This parameter may be nil. 181 | @see robinsonCombinerOn:userInfo: 182 | @see robinsonFisherCombinerOn:userInfo: 183 | */ 184 | - (void)setProbabilitiesCombinerWithTarget:(id)target selector:(SEL)selector userInfo:(id)userInfo; 185 | 186 | /** Compute Robinson's combiner on a series of probabilities. 187 | 188 | @param probabilities An array of @c NSNumber containing float numbers. 189 | @param userInfo Custom user info for the combiner. Unused in this method. 190 | @return A single probability representing the serie. 191 | @see robinsonFisherCombinerOn:userInfo: 192 | */ 193 | - (float)robinsonCombinerOn:(NSArray*)probabilities userInfo:(id)userInfo; 194 | 195 | /** Compute Robinson-Fisher's combiner on a series of probabilities. 196 | 197 | @param probabilities An array of @c NSNumber containing float numbers. 198 | @param userInfo Custom user info for the combiner. Unused in this method. 199 | @return A single probability representing the serie. 200 | @see robinsonCombinerOn:userInfo: 201 | */ 202 | - (float)robinsonFisherCombinerOn:(NSArray*)probabilities userInfo:(id)userInfo; 203 | 204 | 205 | ////////////////////////////////////////////////////////////////////////////////////////// 206 | /// @name Training a classifier 207 | ////////////////////////////////////////////////////////////////////////////////////////// 208 | 209 | /** Train the classifier on a file. 210 | 211 | @param path The path to the file on which the classifier will train. 212 | @param poolName The name of the pool to which the content of the file belongs. 213 | @see trainWithString:forPoolNamed: 214 | @see trainWithTokens:forPoolNamed: 215 | */ 216 | - (void)trainWithFile:(NSString*)path forPoolNamed:(NSString*)poolName; 217 | 218 | /** Train the classifier on a string. 219 | 220 | @param trainString The string on which the classifier will train. 221 | @param poolName The name of the pool to which the content of the file belongs. 222 | @see trainWithFile:forPoolNamed: 223 | @see trainWithTokens:forPoolNamed: 224 | */ 225 | - (void)trainWithString:(NSString*)trainString forPoolNamed:(NSString*)poolName; 226 | 227 | /** Train the classifier on a group of tokens. 228 | 229 | @param tokens Tokens to add to one of the classifier's pool. 230 | @param poolName The name of the pool where the tokens belongs. 231 | @see trainWithFile:forPoolNamed: 232 | @see trainWithString:forPoolNamed: 233 | */ 234 | - (void)trainWithTokens:(NSArray*)tokens inPool:(BKDataPool*)pool; 235 | 236 | 237 | ////////////////////////////////////////////////////////////////////////////////////////// 238 | /// @name Guessing with the classifier 239 | ////////////////////////////////////////////////////////////////////////////////////////// 240 | 241 | /** Ask the classifier to guess on a file. 242 | 243 | @param path The path to the file on which the classifier will make a guess. 244 | @return A dictionary with every pools' names as keys and theirs probability to 245 | be associated with the file's content. 246 | @see guessWithString: 247 | @see guessWithTokens: 248 | */ 249 | - (NSDictionary*)guessWithFile:(NSString*)path; 250 | 251 | /** Ask the classifier to guess on a string. 252 | 253 | @param string The string on which the classifier will make a guess. 254 | @return A dictionary with every pools' names as keys and theirs probability to 255 | be associated with the string. 256 | @see guessWithFile: 257 | @see guessWithTokens: 258 | */ 259 | - (NSDictionary*)guessWithString:(NSString*)string; 260 | 261 | /** Ask the classifier to guess on a group of tokens. 262 | 263 | @param tokens Tokens on which the classifier will make a guess. 264 | @return A dictionary with every pools' names as keys and theirs probability to 265 | be associated with those tokens. 266 | @see guessWithFile: 267 | @see guessWithString: 268 | */ 269 | - (NSDictionary*)guessWithTokens:(NSArray*)tokens; 270 | 271 | 272 | ////////////////////////////////////////////////////////////////////////////////////////// 273 | /// @name Optimizing the classifier 274 | ////////////////////////////////////////////////////////////////////////////////////////// 275 | 276 | /** Remove any tokens with a total count lower than a given level. 277 | 278 | @param level The minimum amount a tokens needs not to get removed. 279 | */ 280 | - (void)stripToLevel:(NSUInteger)level; 281 | 282 | 283 | ////////////////////////////////////////////////////////////////////////////////////////// 284 | /// @name Getting informations 285 | ////////////////////////////////////////////////////////////////////////////////////////// 286 | 287 | /** Print some basics statistics on the pools */ 288 | - (void)printInformations; 289 | 290 | @end 291 | 292 | 293 | ////////////////////////////////////////////////////////////////////////////////////////// 294 | /// @name Constants 295 | ////////////////////////////////////////////////////////////////////////////////////////// 296 | 297 | /** Pool name for the corpus' pool */ 298 | extern NSString* const BKCorpusDataPoolName; 299 | -------------------------------------------------------------------------------- /src/BKClassifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKBayesianClassifier.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | #import 40 | 41 | NSString* const BKCorpusDataPoolName = @"__BKCorpus__"; 42 | 43 | @interface BKClassifier (Private) 44 | + (float)chiSquare:(float)chi withDegreeOfFreedom:(NSUInteger)df; 45 | - (void)buildProbabilityCache; 46 | @end 47 | 48 | 49 | 50 | @implementation BKClassifier 51 | 52 | @synthesize pools; 53 | @synthesize probabilitiesCombinerInvocation; 54 | @synthesize tokenizer; 55 | 56 | - (id)init 57 | { 58 | self = [super init]; 59 | if (self) { 60 | corpus = [[BKDataPool alloc] initWithName:BKCorpusDataPoolName]; 61 | pools = [[NSMutableDictionary alloc] init]; 62 | dirty = YES; 63 | 64 | [self setProbabilitiesCombinerWithTarget:self 65 | selector:@selector(robinsonFisherCombinerOn:userInfo:) 66 | userInfo:nil]; 67 | 68 | tokenizer = [[BKTokenizer alloc] init]; 69 | } 70 | return self; 71 | } 72 | 73 | - (id)initWithContentsOfFile:(NSString*)path 74 | { 75 | self = [[NSKeyedUnarchiver unarchiveObjectWithFile:path] retain]; 76 | if (self) { 77 | } 78 | return self; 79 | } 80 | 81 | 82 | - (void)dealloc 83 | { 84 | [corpus release]; 85 | [pools release]; 86 | [super dealloc]; 87 | } 88 | 89 | #pragma mark - 90 | #pragma mark NSCoding Methods 91 | - (id)initWithCoder:(NSCoder*)coder 92 | { 93 | self = [super init]; 94 | if (self) { 95 | tokenizer = [[BKTokenizer alloc] init]; 96 | dirty = YES; 97 | 98 | corpus = [[coder decodeObjectForKey:@"Corpus"] retain]; 99 | pools = [[coder decodeObjectForKey:@"Pools"] retain]; 100 | 101 | [self setProbabilitiesCombinerWithTarget:self 102 | selector:@selector(robinsonFisherCombinerOn:userInfo:) 103 | userInfo:nil]; 104 | } 105 | return self; 106 | } 107 | 108 | - (void)encodeWithCoder:(NSCoder*)coder 109 | { 110 | [coder encodeObject:corpus forKey:@"Corpus"]; 111 | [coder encodeObject:pools forKey:@"Pools"]; 112 | } 113 | 114 | #pragma mark - 115 | #pragma mark Creation Methods 116 | - (BKClassifier*)classifierWithContentsOfFile:(NSString*)path 117 | { 118 | return [[[BKClassifier alloc] initWithContentsOfFile:path] autorelease]; 119 | } 120 | 121 | #pragma mark - 122 | #pragma mark Saving Methods 123 | - (BOOL)writeToFile:(NSString*)path 124 | { 125 | return [NSKeyedArchiver archiveRootObject:self toFile:path]; 126 | } 127 | 128 | #pragma mark - 129 | #pragma mark Pool Management 130 | - (BKDataPool*)poolNamed:(NSString*)poolName 131 | { 132 | BKDataPool *pool; 133 | pool = [pools objectForKey:poolName]; 134 | 135 | if (pool == nil) { 136 | pool = [[[BKDataPool alloc] initWithName:poolName] autorelease]; 137 | [pools setObject:pool forKey:poolName]; 138 | dirty = YES; 139 | } 140 | return pool; 141 | } 142 | 143 | - (void)removePoolNamed:(NSString*)poolName 144 | { 145 | [pools removeObjectForKey:poolName]; 146 | dirty = YES; 147 | } 148 | 149 | #pragma mark - 150 | #pragma mark Probabilities 151 | - (void)updatePoolsProbabilities 152 | { 153 | if (dirty) { 154 | [self buildProbabilityCache]; 155 | dirty = NO; 156 | } 157 | } 158 | 159 | - (void)buildProbabilityCache 160 | { 161 | for (NSString *poolName in pools) { 162 | BKDataPool *pool = [pools objectForKey:poolName]; 163 | 164 | NSUInteger poolTotalCount = [pool tokensTotalCount]; 165 | NSUInteger deltaTotalCount = MAX([corpus tokensTotalCount] - poolTotalCount, 1u); 166 | 167 | for (NSString *token in pool) { 168 | NSUInteger corpusCount = [corpus countForToken:token]; 169 | NSUInteger poolCount = [pool countForToken:token]; 170 | NSUInteger deltaCount = corpusCount - poolCount; 171 | 172 | float goodMetric; 173 | if (poolTotalCount == 0) { 174 | goodMetric = 1.f; 175 | } else { 176 | goodMetric = MIN(1.f, (float)deltaCount/(float)poolTotalCount); 177 | } 178 | float badMetric = MIN(1.f, (float)poolCount/(float)deltaTotalCount); 179 | float f = badMetric / (goodMetric + badMetric); 180 | 181 | if (fabs(f - 0.5f) >= 0.1) [pool setProbability:f forToken:token]; 182 | } 183 | } 184 | } 185 | 186 | #pragma mark - 187 | #pragma mark Combiners 188 | - (void)setProbabilitiesCombinerWithTarget:(id)target selector:(SEL)selector userInfo:(id)userInfo 189 | { 190 | SEL signatureSelector = @selector(robinsonCombinerOn:userInfo:); 191 | NSMethodSignature *signature = [BKClassifier instanceMethodSignatureForSelector:signatureSelector]; 192 | NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; 193 | 194 | [invocation setTarget:target]; 195 | [invocation setSelector:selector]; 196 | [invocation setArgument:&userInfo atIndex:3]; 197 | [invocation retainArguments]; 198 | 199 | [self setProbabilitiesCombinerInvocation:invocation]; 200 | } 201 | 202 | - (float)robinsonCombinerOn:(NSArray*)probabilities userInfo:(id) __unused userInfo 203 | { 204 | NSUInteger length = [probabilities count]; 205 | float nth = 1.0f / (uint32_t)length; 206 | float probs[length], inverseProbs[length]; 207 | 208 | NSUInteger idx = 0; 209 | for (NSNumber *probability in probabilities) { 210 | probs[idx] = [probability floatValue]; 211 | inverseProbs[idx] = 1.0f - [probability floatValue]; 212 | idx++; 213 | } 214 | 215 | float inverseProbsReduced = inverseProbs[0]; 216 | float probsReduced = probs[0]; 217 | for (NSUInteger i = 1; i < length; i++) { 218 | inverseProbsReduced = inverseProbsReduced * inverseProbs[i]; 219 | probsReduced = probsReduced * probs[i]; 220 | } 221 | 222 | float P = 1.0f - powf(inverseProbsReduced, nth); 223 | float Q = 1.0f - powf(probsReduced, nth); 224 | 225 | float S = (P - Q) / (P + Q); 226 | return (1.0f + S) / 2.0f; 227 | } 228 | 229 | - (float)robinsonFisherCombinerOn:(NSArray*)probabilities userInfo:(id) __unused userInfo 230 | { 231 | NSUInteger length = [probabilities count]; 232 | float probs[length], inverseProbs[length]; 233 | 234 | if (length > (NSUIntegerMax / 2)) { 235 | @throw [NSException exceptionWithName:@"NSUInteger overflow" 236 | reason:@"Too much probabilities to be combined" 237 | userInfo:nil]; 238 | } 239 | 240 | NSUInteger idx = 0; 241 | for (NSNumber *probability in probabilities) { 242 | probs[idx] = [probability floatValue]; 243 | inverseProbs[idx] = (1.0f - [probability floatValue]); 244 | idx++; 245 | } 246 | 247 | float inverseProbsReduced = inverseProbs[0]; 248 | float probsReduced = probs[0]; 249 | for (NSUInteger i = 1; i < length; i++) { 250 | inverseProbsReduced = inverseProbsReduced * inverseProbs[i]; 251 | probsReduced = probsReduced * probs[i]; 252 | } 253 | 254 | float H = [BKClassifier chiSquare:(-2.0f * logf(probsReduced)) withDegreeOfFreedom:(2 * length)]; 255 | float S = [BKClassifier chiSquare:(-2.0f * logf(inverseProbsReduced)) withDegreeOfFreedom:(2 * length)]; 256 | 257 | return (1.0f + H - S) / 2.0f; 258 | } 259 | 260 | #pragma mark - 261 | #pragma mark Trainning Methods 262 | - (void)trainWithFile:(NSString*)path forPoolNamed:(NSString*)poolName 263 | { 264 | NSError *error = nil; 265 | NSString *content = [NSString stringWithContentsOfFile:path 266 | encoding:NSUTF8StringEncoding 267 | error:&error]; 268 | if (error) { 269 | NSLog(@"Error - %@", [error localizedDescription]); 270 | return; 271 | } 272 | [self trainWithString:content forPoolNamed:poolName]; 273 | } 274 | 275 | - (void)trainWithString:(NSString*)trainString forPoolNamed:(NSString*)poolName 276 | { 277 | NSArray *tokens = [tokenizer tokenizeString:trainString]; 278 | BKDataPool *pool = [self poolNamed:poolName]; 279 | [self trainWithTokens:tokens inPool:pool]; 280 | } 281 | 282 | - (void)trainWithTokens:(NSArray*)tokens inPool:(BKDataPool*)pool 283 | { 284 | for (NSString *token in tokens) { 285 | if (!token || [token isEqual:@""]) continue; 286 | [pool increaseCountForToken:token]; 287 | [corpus increaseCountForToken:token]; 288 | } 289 | dirty = YES; 290 | } 291 | 292 | #pragma mark - 293 | #pragma mark Guessing Methods 294 | - (NSDictionary*)guessWithFile:(NSString*)path 295 | { 296 | NSError *error = nil; 297 | NSString *content = [NSString stringWithContentsOfFile:path 298 | encoding:NSUTF8StringEncoding 299 | error:&error]; 300 | if (error) { 301 | NSLog(@"Error - %@", [error localizedDescription]); 302 | return nil; 303 | } 304 | return [self guessWithString:content]; 305 | } 306 | 307 | - (NSDictionary*)guessWithString:(NSString*)string 308 | { 309 | NSArray *tokens = [tokenizer tokenizeString:string]; 310 | return [self guessWithTokens:tokens]; 311 | } 312 | 313 | - (NSDictionary*)guessWithTokens:(NSArray*)tokens 314 | { 315 | [self updatePoolsProbabilities]; 316 | NSMutableDictionary *result = [NSMutableDictionary dictionaryWithCapacity:[pools count]]; 317 | 318 | for (NSString *poolName in pools) { 319 | BKDataPool *pool = [pools objectForKey:poolName]; 320 | NSArray *tokensProbabilities = [pool probabilitiesForTokens:tokens]; 321 | 322 | if ([tokensProbabilities count] > 0) { 323 | float probabilityCombined; 324 | [probabilitiesCombinerInvocation setArgument:&tokensProbabilities atIndex:2]; 325 | [probabilitiesCombinerInvocation invoke]; 326 | [probabilitiesCombinerInvocation getReturnValue:&probabilityCombined]; 327 | [result setObject:[NSNumber numberWithFloat:probabilityCombined] 328 | forKey:poolName]; 329 | } 330 | } 331 | 332 | return result; 333 | } 334 | 335 | #pragma mark - 336 | #pragma mark Sanitizing Methods 337 | - (void)stripToLevel:(NSUInteger)level 338 | { 339 | for (NSString *token in [corpus allTokens]) { 340 | NSUInteger count = [corpus countForToken:token]; 341 | 342 | if (count < level) { 343 | for (NSString *poolName in pools) { 344 | BKDataPool *pool = [pools objectForKey:poolName]; 345 | [pool removeToken:token]; 346 | } 347 | [corpus removeToken:token]; 348 | } 349 | } 350 | } 351 | 352 | #pragma mark - 353 | #pragma mark Printing Methods 354 | - (void)printInformations 355 | { 356 | [self updatePoolsProbabilities]; 357 | [corpus printInformations]; 358 | for (NSString *poolName in pools) { 359 | [[pools objectForKey:poolName] printInformations]; 360 | } 361 | } 362 | 363 | #pragma mark - 364 | #pragma mark Private Methods 365 | + (float)chiSquare:(float)chi withDegreeOfFreedom:(NSUInteger)df 366 | { 367 | float m = chi / 2.0f; 368 | float sum, term; 369 | 370 | if ((df & 1) == 1) return -1.0f; 371 | 372 | sum = term = expf(-m); 373 | for (NSUInteger i = 1; i < (df / 2); i++) { 374 | term *= m/(int32_t)i; 375 | sum += term; 376 | } 377 | 378 | return MIN(sum, 1.0f); 379 | } 380 | 381 | 382 | @end 383 | -------------------------------------------------------------------------------- /src/BKDataPool.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKDataPool.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | 40 | /** Pool indexed by tokens and holding their data. 41 | 42 | You should never have to handle an object of this class directly. 43 | */ 44 | @interface BKDataPool : NSObject { 45 | NSString *name; 46 | 47 | @private 48 | NSUInteger _tokensTotalCount; 49 | NSMutableDictionary *_tokensData; 50 | } 51 | 52 | 53 | ////////////////////////////////////////////////////////////////////////////////////////// 54 | /// @name Properties 55 | ////////////////////////////////////////////////////////////////////////////////////////// 56 | 57 | /** Name of the pool. */ 58 | @property (readonly) NSString *name; 59 | 60 | @property (readonly, getter=tokensTotalCount) NSUInteger _tokensTotalCount; 61 | 62 | 63 | ////////////////////////////////////////////////////////////////////////////////////////// 64 | /// @name Initialize a pool 65 | ////////////////////////////////////////////////////////////////////////////////////////// 66 | 67 | /** Initialize a data pool with a given name. 68 | 69 | @param aName The pool's name. 70 | @return An initialized data pool. 71 | */ 72 | - (id)initWithName:(NSString*)aName; 73 | 74 | 75 | ////////////////////////////////////////////////////////////////////////////////////////// 76 | /// @name Handling tokens' count 77 | ////////////////////////////////////////////////////////////////////////////////////////// 78 | 79 | /** Returns the number of occurences counted for a token. 80 | 81 | @param token The token to get the count property from. 82 | @return The number of occurences counted for the token. 0 if no token is found. 83 | */ 84 | - (NSUInteger)countForToken:(NSString*)token; 85 | 86 | /** Sets the number of occurences counted for a token. 87 | 88 | This will add the token to the pool with the given count number or will replace 89 | the existing one. 90 | @param count The number of occurences counted. 91 | @param token The token counted. 92 | @see addCount:forToken: 93 | */ 94 | - (void)setCount:(NSUInteger)count forToken:(NSString*)token; 95 | 96 | /** Adds to the number of occurences counted for a token. 97 | 98 | This will add the token to the pool with the given count number or will be 99 | added to the existing one. 100 | @param count The number of occurences counted to ass. 101 | @param token The token counted. 102 | @exception NSException if the count property will overflow. 103 | @see setCount:forToken: 104 | */ 105 | - (void)addCount:(NSUInteger)count forToken:(NSString*)token; 106 | 107 | /** Increase the number of occurences counted for a token by 1. 108 | 109 | Act like @c addCount:forToken:() with the count argument set to 1. 110 | @param token The token counted. 111 | @see addCount:forToken: 112 | @see setCount:forToken: 113 | */ 114 | - (void)increaseCountForToken:(NSString*)token; 115 | 116 | 117 | ////////////////////////////////////////////////////////////////////////////////////////// 118 | /// @name Handling tokens' probability 119 | ////////////////////////////////////////////////////////////////////////////////////////// 120 | 121 | /** Returns the probability associated with a token. 122 | 123 | @param token The token to get the probability property from. 124 | @return The probability associated with the token. 0 if no token is found. 125 | @see probabilitiesForTokens: 126 | */ 127 | - (float)probabilityForToken:(NSString*)token; 128 | 129 | /** Returns an array containing the probabilities for a group of tokens 130 | 131 | Only the probabilities of tokens existing within the pool are returned. 132 | The others are simply ignored. So the array returned may be smaller than the tokens' one. 133 | @param tokens An array containing tokens. 134 | @return An array of NSNumber holding tokens probabilities. 135 | @see probabilityForToken: 136 | */ 137 | - (NSArray*)probabilitiesForTokens:(NSArray*)tokens; 138 | 139 | /** Sets the probability associated with a token. 140 | 141 | Unlike @c setCount:forToken: This will @b not add the token to the pool. 142 | @param count The probability for the token. 143 | @param token The token associated. 144 | */ 145 | - (void)setProbability:(float)probability forToken:(NSString*)token; 146 | 147 | 148 | ////////////////////////////////////////////////////////////////////////////////////////// 149 | /// @name Remove tokens 150 | ////////////////////////////////////////////////////////////////////////////////////////// 151 | 152 | /** Remove a token from the pool and release any associated data. 153 | 154 | @param token The token to remove. 155 | */ 156 | - (void)removeToken:(NSString*)token; 157 | 158 | 159 | ////////////////////////////////////////////////////////////////////////////////////////// 160 | /// @name Accessing tokens 161 | ////////////////////////////////////////////////////////////////////////////////////////// 162 | 163 | /** Returns every token of the pool. */ 164 | - (NSArray*)allTokens; 165 | 166 | 167 | ////////////////////////////////////////////////////////////////////////////////////////// 168 | /// @name Print statistics 169 | ////////////////////////////////////////////////////////////////////////////////////////// 170 | 171 | /** Print some basics statistics on the receiver */ 172 | - (void)printInformations; 173 | 174 | @end 175 | -------------------------------------------------------------------------------- /src/BKDataPool.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKDataPool.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | #import 40 | 41 | 42 | @implementation BKDataPool 43 | 44 | @synthesize name; 45 | @synthesize _tokensTotalCount; 46 | 47 | - (id)initWithName:(NSString*)aName 48 | { 49 | self = [super init]; 50 | if (self) { 51 | name = [aName retain]; 52 | _tokensData = [[NSMutableDictionary alloc] init]; 53 | } 54 | return self; 55 | } 56 | 57 | - (void)dealloc 58 | { 59 | [name release]; 60 | [_tokensData release]; 61 | [super dealloc]; 62 | } 63 | 64 | #pragma mark - 65 | #pragma mark NSCoding Methods 66 | - (id)initWithCoder:(NSCoder*)coder 67 | { 68 | self = [super init]; 69 | if (self) { 70 | name = [[coder decodeObjectForKey:@"Name"] retain]; 71 | _tokensTotalCount = [coder decodeIntegerForKey:@"TotalCount"]; 72 | _tokensData = [[coder decodeObjectForKey:@"TokensData"] retain]; 73 | } 74 | return self; 75 | } 76 | 77 | - (void)encodeWithCoder:(NSCoder*)coder 78 | { 79 | [coder encodeObject:name forKey:@"Name"]; 80 | [coder encodeInteger:_tokensTotalCount forKey:@"TotalCount"]; 81 | [coder encodeObject:_tokensData forKey:@"TokensData"]; 82 | } 83 | 84 | #pragma mark - 85 | #pragma mark Token Counting Methods 86 | - (NSUInteger)countForToken:(NSString*)token 87 | { 88 | BKTokenData *data = [_tokensData objectForKey:token]; 89 | if (data) { 90 | return [data count]; 91 | } else { 92 | return 0; 93 | } 94 | } 95 | 96 | - (void)setCount:(NSUInteger)count forToken:(NSString*)token 97 | { 98 | _tokensTotalCount -= [self countForToken:token]; 99 | [_tokensData setObject:[BKTokenData tokenDataWithCount:count] 100 | forKey:token]; 101 | _tokensTotalCount += count; 102 | } 103 | 104 | - (void)addCount:(NSUInteger)count forToken:(NSString*)token 105 | { 106 | BKTokenData *data = [_tokensData objectForKey:token]; 107 | if (!data) { 108 | data = [BKTokenData tokenDataWithCount:count]; 109 | } else { 110 | if ((NSUIntegerMax - count) < [data count]) { 111 | @throw [NSException exceptionWithName:@"NSUInteger overflow" 112 | reason:@"If token count is too high" 113 | userInfo:nil]; 114 | } 115 | data = [BKTokenData tokenDataWithCount:(count + [data count])]; 116 | } 117 | _tokensTotalCount+=count; 118 | [_tokensData setObject:data forKey:token]; 119 | } 120 | 121 | - (void)increaseCountForToken:(NSString*)token 122 | { 123 | NSUInteger count = [self countForToken:token]; 124 | [_tokensData setObject:[BKTokenData tokenDataWithCount:count+1] 125 | forKey:token]; 126 | _tokensTotalCount++; 127 | } 128 | 129 | #pragma mark - 130 | #pragma mark Token Probabilities Methods 131 | - (float)probabilityForToken:(NSString*)token 132 | { 133 | BKTokenData *data = [_tokensData objectForKey:token]; 134 | if (data) { 135 | return [data probability]; 136 | } else { 137 | return 0.0f; 138 | } 139 | } 140 | 141 | - (void)setProbability:(float)probability forToken:(NSString*)token 142 | { 143 | BKTokenData *data = [_tokensData objectForKey:token]; 144 | if (data) { 145 | [data setProbability:probability]; 146 | } 147 | } 148 | 149 | - (NSArray*)probabilitiesForTokens:(NSArray*)tokens 150 | { 151 | NSMutableArray *probabilities = [NSMutableArray arrayWithCapacity:[tokens count]]; 152 | 153 | for (NSString *token in tokens) { 154 | float probability = [self probabilityForToken:token]; 155 | if (probability > 0) { 156 | [probabilities addObject:[NSNumber numberWithFloat:probability]]; 157 | } 158 | } 159 | [probabilities sortUsingSelector:@selector(compare:)]; 160 | 161 | return probabilities; 162 | } 163 | 164 | #pragma mark - 165 | #pragma mark General Token Manipulation 166 | - (NSArray*)allTokens 167 | { 168 | return [_tokensData allKeys]; 169 | } 170 | 171 | - (void)removeToken:(NSString*)token 172 | { 173 | _tokensTotalCount -= [self countForToken:token]; 174 | [_tokensData removeObjectForKey:token]; 175 | } 176 | 177 | 178 | #pragma mark - 179 | #pragma mark Printing Methods 180 | - (NSString*)description 181 | { 182 | return [_tokensData description]; 183 | } 184 | 185 | - (void)printInformations 186 | { 187 | NSLog(@"%@ Informations:", name); 188 | NSLog(@" Number of tokens: %llu", [_tokensData count]); 189 | NSLog(@" Total count of tokens: %llu", _tokensTotalCount); 190 | 191 | NSArray *keys = [_tokensData keysSortedByValueUsingSelector:@selector(compareCount:)]; 192 | NSString *token = [keys lastObject]; 193 | NSLog(@" Most counted token: %@ counted %llu times", token, [self countForToken:token]); 194 | } 195 | 196 | #pragma mark - 197 | #pragma mark NSFastEnumeration Methods 198 | - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len 199 | { 200 | return [_tokensData countByEnumeratingWithState:state objects:stackbuf count:len]; 201 | } 202 | 203 | @end 204 | -------------------------------------------------------------------------------- /src/BKTokenData.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKTokenData.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | 40 | /** Helper class for @c BKDataPool holding information on a token 41 | 42 | You should never have to handle directly an object of this type. 43 | */ 44 | @interface BKTokenData : NSObject { 45 | NSUInteger count; 46 | float probability; 47 | } 48 | 49 | 50 | ////////////////////////////////////////////////////////////////////////////////////////// 51 | /// @name Properties 52 | ////////////////////////////////////////////////////////////////////////////////////////// 53 | 54 | /** Number of occurence of a token within a pool */ 55 | @property (readwrite, assign) NSUInteger count; 56 | /** Probability associated with a token in a pool */ 57 | @property (readwrite, assign) float probability; 58 | 59 | 60 | ////////////////////////////////////////////////////////////////////////////////////////// 61 | /// @name Creating a token data 62 | ////////////////////////////////////////////////////////////////////////////////////////// 63 | 64 | /** Create a new token data and setup its @c count property. 65 | 66 | @param aCount The number to set @c count with. 67 | @return A new token data. 68 | @see initWithCount 69 | */ 70 | + (BKTokenData*)tokenDataWithCount:(NSUInteger)aCount; 71 | 72 | 73 | ////////////////////////////////////////////////////////////////////////////////////////// 74 | /// @name Initializing a token data 75 | ////////////////////////////////////////////////////////////////////////////////////////// 76 | 77 | /** Initialize a new token data and setup its @c count property. 78 | 79 | @param aCount The number to set @c count with. 80 | @return An initialized token data. 81 | @see tokenDataWithCount: 82 | */ 83 | - (id)initWithCount:(NSUInteger)aCount; 84 | 85 | 86 | ////////////////////////////////////////////////////////////////////////////////////////// 87 | /// @name Comparing token data 88 | ////////////////////////////////////////////////////////////////////////////////////////// 89 | 90 | /** Compare two token data by theirs @c count properties 91 | 92 | @param other The other token data to compare with. 93 | @return 94 | - NSOrderedAscending if the count of the other is greater than the receiver’s 95 | - NSOrderedSame if they’re equal 96 | - NSOrderedDescending if the count of the other is less than the receiver’s. 97 | @see compareProbability 98 | */ 99 | - (NSComparisonResult)compareCount:(BKTokenData*)other; 100 | 101 | /** Compare two token data by theirs @c probability properties 102 | 103 | @param other The other token data to compare with. 104 | @return 105 | - NSOrderedAscending if the probability of the other is greater than the receiver’s 106 | - NSOrderedSame if they’re equal 107 | - NSOrderedDescending if the probability of the other is less than the receiver’s. 108 | @see compareCount: 109 | */ 110 | - (NSComparisonResult)compareProbability:(BKTokenData*)other; 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /src/BKTokenData.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKTokenData.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | 40 | 41 | @implementation BKTokenData 42 | 43 | @synthesize count; 44 | @synthesize probability; 45 | 46 | - (id)initWithCount:(NSUInteger)aCount 47 | { 48 | self = [super init]; 49 | if (self) { 50 | [self setCount:aCount]; 51 | } 52 | return self; 53 | } 54 | 55 | + (BKTokenData*)tokenDataWithCount:(NSUInteger)aCount 56 | { 57 | return [[[BKTokenData alloc] initWithCount:aCount] autorelease]; 58 | } 59 | 60 | #pragma mark - 61 | #pragma mark NSCoding Methods 62 | - (id)initWithCoder:(NSCoder*)coder 63 | { 64 | self = [super init]; 65 | if (self) { 66 | count = [coder decodeIntegerForKey:@"Count"]; 67 | probability = [coder decodeFloatForKey:@"Probability"]; 68 | } 69 | return self; 70 | } 71 | 72 | - (void)encodeWithCoder:(NSCoder*)coder 73 | { 74 | [coder encodeInteger:count forKey:@"Count"]; 75 | [coder encodeFloat:probability forKey:@"Probability"]; 76 | } 77 | 78 | #pragma mark - 79 | #pragma mark Custom Setters 80 | - (void)setProbability:(float)aProbability 81 | { 82 | probability = MIN(0.9999f, aProbability); 83 | probability = MAX(0.0001f, probability); 84 | } 85 | 86 | #pragma mark - 87 | #pragma mark Comparison Methods 88 | - (NSComparisonResult)compareCount:(BKTokenData*)other 89 | { 90 | return [[NSNumber numberWithUnsignedInteger:count] compare: 91 | [NSNumber numberWithUnsignedInteger:[other count]]]; 92 | } 93 | 94 | - (NSComparisonResult)compareProbability:(BKTokenData*)other 95 | { 96 | return [[NSNumber numberWithFloat:probability] compare: 97 | [NSNumber numberWithFloat:[other probability]]]; 98 | } 99 | 100 | #pragma mark - 101 | #pragma mark Printing Methods 102 | - (NSString*)description 103 | { 104 | return [NSString stringWithFormat:@"{count: %llu, probability: %f}", count, probability]; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /src/BKTokenizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKTokenizer.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | #import 40 | 41 | /** Simple tokenizer based on ParseKit aimed to tokenize source code. */ 42 | @interface BKTokenizer : NSObject { 43 | BOOL lowerCaseTokens; 44 | } 45 | 46 | ////////////////////////////////////////////////////////////////////////////////////////// 47 | /// @name Properties 48 | ////////////////////////////////////////////////////////////////////////////////////////// 49 | 50 | /** If set to YES the tokenizer will return only lowercase tokens. */ 51 | @property (readwrite) BOOL lowerCaseTokens; 52 | 53 | 54 | ////////////////////////////////////////////////////////////////////////////////////////// 55 | /// @name Tokenizing 56 | ////////////////////////////////////////////////////////////////////////////////////////// 57 | 58 | /** Returns every tokens found in a string. 59 | 60 | @param string The string to tokenize. 61 | @return An array filled with every tokens. 62 | */ 63 | - (NSArray*)tokenizeString:(NSString *)string; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /src/BKTokenizer.m: -------------------------------------------------------------------------------- 1 | // 2 | // BKTokenizer.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | #import 40 | 41 | 42 | @implementation BKTokenizer 43 | 44 | @synthesize lowerCaseTokens; 45 | 46 | - (id)init 47 | { 48 | self = [super init]; 49 | if (self) { 50 | lowerCaseTokens = YES; 51 | } 52 | return self; 53 | } 54 | 55 | - (NSArray*)tokenizeString:(NSString *)string 56 | { 57 | PKTokenizer *tokenizer = [PKTokenizer tokenizerWithString:string]; 58 | 59 | PKToken *eof = [PKToken EOFToken]; 60 | PKToken *token = nil; 61 | NSMutableSet *tokens = [NSMutableSet set]; 62 | 63 | while ((token = [tokenizer nextToken]) != eof) { 64 | if ([token tokenType] == PKTokenTypeWord || [token tokenType] == PKTokenTypeSymbol) { 65 | NSString *tokenString = [token stringValue]; 66 | if (lowerCaseTokens) { 67 | tokenString = [tokenString lowercaseString]; 68 | } 69 | [tokens addObject:tokenString]; 70 | } 71 | } 72 | 73 | return [tokens allObjects]; 74 | } 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /src/BKTokenizing.h: -------------------------------------------------------------------------------- 1 | // 2 | // BKTokenizing.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | 40 | 41 | /** Defines the requirements for a tokenizer 42 | 43 | Tokenizer are objects called to split the input string into tokens. 44 | */ 45 | @protocol BKTokenizing 46 | 47 | 48 | ////////////////////////////////////////////////////////////////////////////////////////// 49 | /// @name Properties 50 | ////////////////////////////////////////////////////////////////////////////////////////// 51 | 52 | /** If set to YES the tokenizer must convert any tokens to lowercase */ 53 | @property (readwrite) BOOL lowerCaseTokens; 54 | 55 | 56 | ////////////////////////////////////////////////////////////////////////////////////////// 57 | /// @name Tokenizing 58 | ////////////////////////////////////////////////////////////////////////////////////////// 59 | 60 | /** Returns every tokens found in a string 61 | 62 | @param string The string to tokenize 63 | @return An array filled with every tokens 64 | */ 65 | - (NSArray*)tokenizeString:(NSString*)string; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /src/BayesianKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // BayesianKit.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | #import 40 | #import 41 | #import 42 | #import -------------------------------------------------------------------------------- /tools/Bayes.h: -------------------------------------------------------------------------------- 1 | // 2 | // Bayes.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | 39 | #import 40 | #import 41 | 42 | @interface Bayes : NSObject { 43 | NSString *filepath; 44 | BKClassifier *classifier; 45 | BOOL saveWhenExiting; 46 | } 47 | 48 | @property (readwrite, retain) NSString *filepath; 49 | @property (readwrite, assign) BOOL saveWhenExiting; 50 | 51 | - (void)processArguments:(NSArray*)arguments; 52 | - (NSArray*)extractValuesInArray:(NSArray*)arguments fromIndex:(NSUInteger)idx; 53 | - (void)prepareClassifier; 54 | 55 | - (void)showVersion; 56 | - (void)showHelp; 57 | - (void)showInvalidNumberOfArgumentsFor:(NSString*)arg; 58 | - (void)showDump; 59 | - (void)terminateWell:(BOOL)well; 60 | - (void)loadFile:(NSString*)path; 61 | - (void)guessOn:(NSArray*)paths; 62 | - (void)trainOn:(NSArray*)paths withPoolNamed:(NSString*)poolName; 63 | - (void)stripToLevel:(NSUInteger)level; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /tools/Bayes.m: -------------------------------------------------------------------------------- 1 | // 2 | // Bayes.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import "Bayes.h" 39 | #import "Utils.h" 40 | 41 | #ifdef ARGUMENT_IS 42 | #undef ARGUMENT_IS 43 | #endif 44 | #define ARGUMENT_IS(short, long) ([argument isEqual:short] || [argument isEqual:long]) 45 | 46 | @implementation Bayes 47 | 48 | @synthesize filepath; 49 | @synthesize saveWhenExiting; 50 | 51 | - (id)init 52 | { 53 | self = [super init]; 54 | if (self) { 55 | } 56 | return self; 57 | } 58 | 59 | - (void)dealloc 60 | { 61 | [classifier release]; 62 | [filepath release]; 63 | [super dealloc]; 64 | } 65 | 66 | #pragma mark - 67 | #pragma mark Arguments Processing 68 | - (void)processArguments:(NSArray *)arguments 69 | { 70 | //First class arguments: If found run them and then stop 71 | if ([arguments containsObject:@"-h"] || [arguments containsObject:@"--help"]) { 72 | [self showHelp]; 73 | [self terminateWell:YES]; 74 | } 75 | 76 | if ([arguments containsObject:@"-v"] || [arguments containsObject:@"--version"]) { 77 | [self showVersion]; 78 | [self terminateWell:YES]; 79 | } 80 | 81 | //Second class arguments: Needs to be run before the third class 82 | NSMutableArray *leftOver = [NSMutableArray arrayWithCapacity:[arguments count]]; 83 | for (int i = 0; i < [arguments count]; i++) { 84 | NSString *argument = [arguments objectAtIndex:i]; 85 | 86 | if ([argument isEqual:@"-f"] || [argument isEqual:@"--file"]) { 87 | [self loadFile:[arguments objectAtIndex:i+1]]; 88 | i++; 89 | } 90 | if ([argument isEqual:@"-s"] || [argument isEqual:@"--save"]) { 91 | [self setSaveWhenExiting:YES]; 92 | } 93 | else { 94 | [leftOver addObject:argument]; 95 | } 96 | } 97 | 98 | [self prepareClassifier]; 99 | 100 | //Third class arguments: Process in order 101 | for (int i = 0; i < [leftOver count]; i++) { 102 | NSString *argument = [leftOver objectAtIndex:i]; 103 | 104 | if ([argument isEqual:@"-g"] || [argument isEqual:@"--guess"]) { 105 | NSArray *files = [self extractValuesInArray:leftOver fromIndex:i+1]; 106 | if (i+1 >= [leftOver count] || [files count] == 0) 107 | [self showInvalidNumberOfArgumentsFor:@"-g/--guess"]; 108 | else 109 | [self guessOn:files]; 110 | i += [files count]; 111 | } 112 | else if ([argument isEqual:@"-t"] || [argument isEqual:@"--train"]) { 113 | NSArray *files = [self extractValuesInArray:leftOver fromIndex:i+2]; 114 | if (i+2 >= [leftOver count] || [files count] == 0) 115 | [self showInvalidNumberOfArgumentsFor:@"-t/--train"]; 116 | else 117 | [self trainOn:files withPoolNamed:[leftOver objectAtIndex:i+1]]; 118 | i += ([files count] + 1); 119 | } 120 | else if ([argument isEqual:@"-d"] || [argument isEqual:@"--dump"]) { 121 | [self showDump]; 122 | } 123 | else if ([argument isEqual:@"-r"] || [argument isEqual:@"--strip"]) { 124 | if (i+1 >= [leftOver count]) [self showInvalidNumberOfArgumentsFor:@"-r/--strip"]; 125 | [self stripToLevel:[[leftOver objectAtIndex:i+1] integerValue]]; 126 | i += 1; 127 | } 128 | } 129 | 130 | [self terminateWell:YES]; 131 | } 132 | 133 | - (NSArray*)extractValuesInArray:(NSArray*)arguments fromIndex:(NSUInteger)idx 134 | { 135 | NSMutableArray *values = [NSMutableArray array]; 136 | for (int i=idx; i < [arguments count]; i++) { 137 | NSString *value = [arguments objectAtIndex:i]; 138 | if ([value hasPrefix:@"-"]) break; 139 | [values addObject:value]; 140 | } 141 | return values; 142 | } 143 | 144 | - (void)prepareClassifier 145 | { 146 | if (filepath) { 147 | @try { 148 | classifier = [[BKClassifier alloc] initWithContentsOfFile:filepath]; 149 | } 150 | @catch (NSException *e) { 151 | PrintOut(@"%@ - Is not a valid classifier archive", filepath); 152 | [self terminateWell:NO]; 153 | } 154 | } 155 | 156 | if (classifier == nil) { 157 | classifier = [[BKClassifier alloc] init]; 158 | } 159 | } 160 | 161 | #pragma mark - 162 | #pragma mark Actions 163 | - (void)showVersion 164 | { 165 | PrintOut(@"%@ - %@ %@", APPNAME, _(@"version"), VERSION); 166 | } 167 | 168 | - (void)showHelp 169 | { 170 | PrintOut(@"Usage:\n" 171 | " bayes [-vh] [-sf] [-tgrd]\n" 172 | " -h/--help What is recursion ?\n" 173 | " -v/--version Display the actual version number.\n" 174 | "\n" 175 | " -f/--file Save/Load classifier training to/from a file.\n" 176 | " -s/--save Save the changes in -f file before exiting.\n" 177 | "\n" 178 | " -t/--train Uses path as training data for a category.\n" 179 | " -g/--guess Guess to which category path is belonging.\n" 180 | " -r/--strip Remove any token with a total count lower than level.\n" 181 | " -d/--dump Print out the whole content of the classifier." 182 | ); 183 | } 184 | 185 | - (void)showInvalidNumberOfArgumentsFor:(NSString*)arg 186 | { 187 | PrintOut(@"Error - Invalid number of arguments for %@ option", arg); 188 | [self terminateWell:NO]; 189 | } 190 | 191 | - (void)showDump 192 | { 193 | [classifier printInformations]; 194 | } 195 | 196 | - (void)terminateWell:(BOOL)well 197 | { 198 | if (well) { 199 | if (saveWhenExiting) [classifier writeToFile:filepath]; 200 | exit(EXIT_SUCCESS); 201 | } else { 202 | exit(EXIT_FAILURE); 203 | } 204 | } 205 | 206 | - (void)loadFile:(NSString*)path 207 | { 208 | if (filepath) { 209 | PrintOut(_(@"Error - Only one -f or --file option can be used")); 210 | [self terminateWell:NO]; 211 | } 212 | 213 | [self setFilepath:path]; 214 | } 215 | 216 | - (void)guessOn:(NSArray*)paths 217 | { 218 | for (NSString *path in paths) { 219 | NSDictionary *results = [classifier guessWithFile:path]; 220 | NSString *maxKey = _(@"Nothing"); 221 | float maxValue = -1.f; 222 | 223 | if ([results count] == 0) { 224 | PrintOut(@"No results, the classifier was either not trained, or you forgot to mention the -f option"); 225 | } 226 | 227 | for (NSString *key in results) { 228 | float value = [[results objectForKey:key] floatValue]; 229 | if (value > maxValue) { 230 | maxValue = value; 231 | maxKey = key; 232 | } 233 | } 234 | 235 | PrintOut(@"%@ : %@ (%02i%%)", path, maxKey, (int)(maxValue*100.f)); 236 | } 237 | } 238 | 239 | - (void)trainOn:(NSArray*)paths withPoolNamed:(NSString*)poolName 240 | { 241 | for (NSString *path in paths) { 242 | [classifier trainWithFile:path forPoolNamed:poolName]; 243 | } 244 | } 245 | 246 | - (void)stripToLevel:(NSUInteger)level 247 | { 248 | [classifier stripToLevel:level]; 249 | } 250 | 251 | @end 252 | -------------------------------------------------------------------------------- /tools/Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.h 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | 40 | #ifndef APPNAME 41 | #define APPNAME @"Bayes" 42 | #endif 43 | 44 | #ifndef VERSION 45 | #define VERSION @"0.1" 46 | #endif 47 | 48 | #ifndef _ 49 | #define _(key) NSLocalizedString(key, nil) 50 | #endif 51 | 52 | #ifndef NSLocalizedLog 53 | #define NSLocalizedLog(key, comment) NSLog(@"%@", NSLocalizedString(key, comment)) 54 | #endif 55 | 56 | void PrintOut(NSString *format, ...); 57 | -------------------------------------------------------------------------------- /tools/Utils.m: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import "Utils.h" 39 | 40 | void PrintOut(NSString *format, ...) 41 | { 42 | va_list args; 43 | 44 | va_start(args, format); 45 | NSString *string; 46 | 47 | string = [[NSString alloc] initWithFormat:format arguments:args]; 48 | va_end(args); 49 | printf("%s\n", [string UTF8String]); 50 | 51 | [string release]; 52 | } -------------------------------------------------------------------------------- /tools/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Licensed under the terms of the BSD License, as specified below. 4 | // 5 | 6 | /* 7 | Copyright (c) 2010, Samuel Mendes 8 | 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without 12 | modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above copyright 15 | notice, this list of conditions and the following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | 21 | * Neither the name of ᐱ nor the names of its 22 | contributors may be used to endorse or promote products derived 23 | from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 31 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #import 39 | #import "Bayes.h" 40 | 41 | int main(int argc, char **argv) { 42 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 43 | 44 | NSProcessInfo *proc = [NSProcessInfo processInfo]; 45 | Bayes *bayes = [[Bayes alloc] init]; 46 | [bayes processArguments:[proc arguments]]; 47 | [bayes release]; 48 | 49 | [pool drain]; 50 | return EXIT_SUCCESS; 51 | } 52 | --------------------------------------------------------------------------------