Changeset e7de6cc
- Timestamp:
- 02/21/12 20:02:51 (13 years ago)
- Branches:
- master
- Children:
- b242df2
- Parents:
- 354ba3d
- git-author:
- Tomasz Obrebski <to@…> (02/21/12 20:02:51)
- git-committer:
- Tomasz Obrebski <to@…> (02/21/12 20:02:51)
- Files:
-
- 33 added
- 17 edited
- 11 moved
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rcfdf333 re7de6cc 41 41 # ------------------------------------------------------------------ 42 42 .PHONY: clean 43 clean: clean_components clean_documentation clean_config 43 clean: clean_components clean_documentation clean_config clean_config_mak 44 44 @echo "All files cleaned successfully!" 45 45 … … 58 58 clean_config: 59 59 cd $(CUR_DIR)/conf && make clean; cd $(CUR_DIR) 60 61 .PHONY: clean_config_mak 62 clean_config_mak: 63 rm config.mak || true 60 64 61 65 # ------------------------------------------------------------------ -
configure
rac25afd re7de6cc 9 9 10 10 # list of components to compile 11 CMPLIST="comp iledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen sen-nl ser tags tok.c tok.l tok.plunfla"11 CMPLIST="compdic cor dgc dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen sen-nl ser tags tok.c tok.l tok.pl tre unfla" 12 12 COMP= 13 13 -
share/cats.dgc
r5f4d9c3 re7de6cc 1 ADJ/DcNpCaGp 2 ADJ/DcNpCd 3 ADJ/DcNpCgl 4 ADJ/DcNpCi 5 ADJ/DcNpCnavGaifn 6 ADJ/DcNpCnvGp 7 ADJ/DcNsCaGi 8 ADJ/DcNsCaGpa 9 ADJ/DcNsCaiGf 10 ADJ/DcNsCavGf 11 ADJ/DcNsCdGpain 12 ADJ/DcNsCgdlGf 13 ADJ/DcNsCgGpain 14 ADJ/DcNsCilGpain 15 ADJ/DcNsCnavGn 16 ADJ/DcNsCnvGpai 17 ADJ/DpNpCaGp 18 ADJ/DpNpCd 19 ADJ/DpNpCgl 20 ADJ/DpNpCi 21 ADJ/DpNpCnavGaifn 22 ADJ/DpNpCnvGp 23 ADJ/DpN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aifn 86 ADJPP/NpCnvGp 87 ADJPP/NsCaGi 88 ADJPP/NsCaGpa 89 ADJPP/NsCaiGf 90 ADJPP/NsCavGf 91 ADJPP/NsCdGpain 92 ADJPP/NsCgdlGf 93 ADJPP/NsCgGpain 94 ADJPP/NsCilGpain 95 ADJPP/NsCnavGn 96 ADJPP/NsCnvGpai 97 ADJPRO/NpCaGp 98 ADJPRO/NpCd 99 ADJPRO/NpCgl 100 ADJPRO/NpCi 101 ADJPRO/NpCnavGaifn 102 ADJPRO/NpCnvGp 103 ADJPRO/NsCaGi 104 ADJPRO/NsCaGpa 105 ADJPRO/NsCaiGf 106 ADJPRO/NsCavGf 107 ADJPRO/NsCdGpain 108 ADJPRO/NsCgdlGf 109 ADJPRO/NsCgGpain 110 ADJPRO/NsCilGpain 111 ADJPRO/NsCnavGn 112 ADJPRO/NsCnvGpai 113 ADJPRO/ZdNpCaGp 114 ADJPRO/ZdNpCd 115 ADJPRO/ZdNpCgl 116 ADJPRO/ZdNpCi 117 ADJPRO/ZdNpCnavGaifn 118 ADJPRO/ZdNpCnvGp 119 ADJPRO/ZdNsCaGi 120 ADJPRO/ZdNsCaGpa 121 ADJPRO/ZdNsCaiGf 122 ADJPRO/ZdNsCavGf 123 ADJPRO/ZdNsCdGpain 124 ADJPRO/ZdNsCgdlGf 125 ADJPRO/ZdNsCgGpain 126 ADJPRO/ZdNsCilGpain 127 ADJPRO/ZdNsCnavGn 128 ADJPRO/ZdNsCnvGpai 129 ADJPRO/ZgNpCaGp 130 ADJPRO/ZgNpCd 131 ADJPRO/ZgNpCgl 132 ADJPRO/ZgNpCi 133 ADJPRO/ZgNpCnavGaifn 134 ADJPRO/ZgNpCnvGp 135 ADJPRO/ZgNsCaGi 136 ADJPRO/ZgNsCaGpa 137 ADJPRO/ZgNsCaiGf 138 ADJPRO/ZgNsCavGf 139 ADJPRO/ZgNsCdGpain 140 ADJPRO/ZgNsCgdlGf 141 ADJPRO/ZgNsCgGpain 142 ADJPRO/ZgNs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 73 ADJPAP/CdNp 74 ADJPAP/CgGainpNs 75 ADJPAP/CglNp 76 ADJPAP/CilGainpNs 77 ADJPAP/CiNp 78 ADJPAP/CnvGaipNs 79 ADJPAP/CnvGfNs 80 ADJPAP/CnvGpNp 81 ADJPP/CaGapNs 82 ADJPP/CaGiNs 83 ADJPP/CaGpNp 84 ADJPP/CaiGfNs 85 ADJPP/CanvGafinNp 86 ADJPP/CanvGnNs 87 ADJPP/CdGainpNs 88 ADJPP/CdglGfNs 89 ADJPP/CdNp 90 ADJPP/CgGainpNs 91 ADJPP/CglNp 92 ADJPP/CilGainpNs 93 ADJPP/CiNp 94 ADJPP/CnvGaipNs 95 ADJPP/CnvGfNs 96 ADJPP/CnvGpNp 97 ADJPRO/CaGapNs 98 ADJPRO/CaGiNs 99 ADJPRO/CaGpNp 100 ADJPRO/CaiGfNs 101 ADJPRO/CanvGafinNp 102 ADJPRO/CanvGnNs 103 ADJPRO/CdGainpNs 104 ADJPRO/CdglGfNs 105 ADJPRO/CdNp 106 ADJPRO/CgGainpNs 107 ADJPRO/CglNp 108 ADJPRO/CilGainpNs 109 ADJPRO/CiNp 110 ADJPRO/CnvGaipNs 111 ADJPRO/CnvGfNs 112 ADJPRO/CnvGpNp 113 ADJPRP/CaGapNs 114 ADJPRP/CaGiNs 115 ADJPRP/CaGpNp 116 ADJPRP/CaiGfNs 117 ADJPRP/CanvGafinNp 118 ADJPRP/CanvGnNs 119 ADJPRP/CdGainpNs 120 ADJPRP/CdglGfNs 121 ADJPRP/CdNp 122 ADJPRP/CgGainpNs 123 ADJPRP/CglNp 124 ADJPRP/CilGainpNs 125 ADJPRP/CiNp 126 ADJPRP/CnvGaipNs 127 ADJPRP/CnvGfNs 128 ADJPRP/CnvGpNp 241 129 ADVANP 130 ADVANP/C 242 131 ADV/Dc 243 132 ADV/Dp … … 245 134 ADVNUM 246 135 ADVPRO 247 ADVPRO/Zd 248 ADVPRO/Zi 249 ADVPRO/Zn 250 ADVPRO/Zq 251 ADVPRO/Zqr 252 ADVPRO/Zr 136 ADVPRO/C 253 137 ADVPRP 138 ADVPRP/C 254 139 APP 140 BYC/GafinMcNpP1Vp 141 BYC/GafinMcNpP2Vp 142 BYC/GafinMcNpP3Vp 143 BYC/GafinMdNpP1TaVp 144 BYC/GafinMdNpP2TaVp 145 BYC/GafinMdNpP3TaVp 146 BYC/GaipMcNsP1Vp 147 BYC/GaipMcNsP2Vp 148 BYC/GaipMcNsP3Vp 149 BYC/GaipMdNsP1TaVp 150 BYC/GaipMdNsP2TaVp 151 BYC/GaipMdNsP3TaVp 152 BYC/GfMcNsP1Vp 153 BYC/GfMcNsP2Vp 154 BYC/GfMcNsP3Vp 155 BYC/GfMdNsP1TaVp 156 BYC/GfMdNsP2TaVp 157 BYC/GfMdNsP3TaVp 158 BYC/GnMcNsP3Vp 159 BYC/GnMdNsP3TaVp 160 BYC/GpMcNpP1Vp 161 BYC/GpMcNpP2Vp 162 BYC/GpMcNpP3Vp 163 BYC/GpMdNpP1TaVp 164 BYC/GpMdNpP2TaVp 165 BYC/GpMdNpP3TaVp 166 BYC/MdNpP1TfrVp 167 BYC/MdNpP2TfrVp 168 BYC/MdNpP3TfrVp 169 BYC/MdNsP1TfrVp 170 BYC/MdNsP2TfrVp 171 BYC/MdNsP3TfrVp 172 BYC/MiNpP1Vp 173 BYC/MiNpP2Vp 174 BYC/MiNsP2Vp 255 175 BYC/Vb 256 BYC/VpMcNpP1Gaifn257 BYC/VpMcNpP1Gp258 BYC/VpMcNpP2Gaifn259 BYC/VpMcNpP2Gp260 BYC/VpMcNpP3Gaifn261 BYC/VpMcNpP3Gp262 BYC/VpMcNsP1Gf263 BYC/VpMcNsP1Gpai264 BYC/VpMcNsP2Gf265 BYC/VpMcNsP2Gpai266 BYC/VpMcNsP3Gf267 BYC/VpMcNsP3Gn268 BYC/VpMcNsP3Gpai269 BYC/VpMdTaNpP1Gaifn270 BYC/VpMdTaNpP1Gp271 BYC/VpMdTaNpP2Gaifn272 BYC/VpMdTaNpP2Gp273 BYC/VpMdTaNpP3Gaifn274 BYC/VpMdTaNpP3Gp275 BYC/VpMdTaNsP1Gf276 BYC/VpMdTaNsP1Gpai277 BYC/VpMdTaNsP2Gf278 BYC/VpMdTaNsP2Gpai279 BYC/VpMdTaNsP3Gf280 BYC/VpMdTaNsP3Gn281 BYC/VpMdTaNsP3Gpai282 BYC/VpMdTrfNpP1283 BYC/VpMdTrfNpP2284 BYC/VpMdTrfNpP3285 BYC/VpMdTrfNsP1286 BYC/VpMdTrfNsP2287 BYC/VpMdTrfNsP3288 BYC/VpMiNpP1289 BYC/VpMiNpP2290 BYC/VpMiNsP2291 176 CONJ 292 177 EXCL 293 N/GaNpCa 294 N/GaNpCd 295 N/GaNpCg 296 N/GaNpCi 297 N/GaNpCl 298 N/GaNpCn 299 N/GaNpCv 300 N/GaNsCa 301 N/GaNsCd 302 N/GaNsCg 303 N/GaNsCi 304 N/GaNsCl 305 N/GaNsCn 306 N/GaNsCv 307 N/GfNpCa 308 N/GfNpCd 309 N/GfNpCg 310 N/GfNpCi 311 N/GfNpCl 312 N/GfNpCn 313 N/GfNpCv 314 N/GfNsCa 315 N/GfNsCd 316 N/GfNsCg 317 N/GfNsCi 318 N/GfNsCl 319 N/GfNsCn 320 N/GfNsCv 321 N/GiNpCa 322 N/GiNpCd 323 N/GiNpCg 324 N/GiNpCi 325 N/GiNpCl 326 N/GiNpCn 327 N/GiNpCv 328 N/GiNsCa 329 N/GiNsCd 330 N/GiNsCg 331 N/GiNsCi 332 N/GiNsCl 333 N/GiNsCn 334 N/GiNsCv 335 N/GnNpCa 336 N/GnNpCd 337 N/GnNpCg 338 N/GnNpCi 339 N/GnNpCl 340 N/GnNpCn 341 N/GnNpCv 342 N/GnNsCa 343 N/GnNsCd 344 N/GnNsCg 345 N/GnNsCi 346 N/GnNsCl 347 N/GnNsCn 348 N/GnNsCv 349 N/G?NpCa 350 N/G*NpCa 351 N/G?NpCd 352 N/G*NpCd 353 N/G?NpCg 354 N/G*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sCi 484 NPRO/ZqrGnNsCl 485 NPRO/ZqrGnNsCn 486 NPRO/ZqrGpNsCa 487 NPRO/ZqrGpNsCd 488 NPRO/ZqrGpNsCg 489 NPRO/ZqrGpNsCi 490 NPRO/ZqrGpNsCl 491 NPRO/ZqrGpNsCn 492 NPRO/ZxG*N*Ca 493 NPRO/ZxG*N*Cd 494 NPRO/ZxG*N*Cg 495 NPRO/ZxG*N*Ci 496 NPRO/ZxG*N*Cl 178 N/Ca 179 N/CaGaNp 180 N/CaGaNs 181 N/CaGfNp 182 N/CaGfNs 183 N/CaGiNp 184 N/CaGiNs 185 N/CaGnNp 186 N/CaGnNs 187 N/CaG?Np 188 N/CaG?Ns 189 N/CaGpNp 190 N/CaGpNs 191 N/CaNp 192 N/Cd 193 N/CdGaNp 194 N/CdGaNs 195 N/CdGfNp 196 N/CdGfNs 197 N/CdGiNp 198 N/CdGiNs 199 N/CdGnNp 200 N/CdGnNs 201 N/CdG?Np 202 N/CdG?Ns 203 N/CdGpNp 204 N/CdGpNs 205 N/CdNp 206 N/Cg 207 N/CgGaNp 208 N/CgGaNs 209 N/CgGfNp 210 N/CgGfNs 211 N/CgGiNp 212 N/CgGiNs 213 N/CgGnNp 214 N/CgGnNs 215 N/CgG?Np 216 N/CgG?Ns 217 N/CgGpNp 218 N/CgGpNs 219 N/CgNp 220 N/Ci 221 N/CiGaNp 222 N/CiGaNs 223 N/CiGfNp 224 N/CiGfNs 225 N/CiGiNp 226 N/CiGiNs 227 N/CiGnNp 228 N/CiGnNs 229 N/CiG?Np 230 N/CiG?Ns 231 N/CiGpNp 232 N/CiGpNs 233 N/CiNp 234 N/Cl 235 N/ClGaNp 236 N/ClGaNs 237 N/ClGfNp 238 N/ClGfNs 239 N/ClGiNp 240 N/ClGiNs 241 N/ClGnNp 242 N/ClGnNs 243 N/ClG?Np 244 N/ClG?Ns 245 N/ClGpNp 246 N/ClGpNs 247 N/ClNp 248 N/Cn 249 N/CnGaNp 250 N/CnGaNs 251 N/CnGfNp 252 N/CnGfNs 253 N/CnGiNp 254 N/CnGiNs 255 N/CnGnNp 256 N/CnGnNs 257 N/CnG?Np 258 N/CnG?Ns 259 N/CnGpNp 260 N/CnGpNs 261 N/CnNp 262 N/CvGaNp 263 N/CvGaNs 264 N/CvGfNp 265 N/CvGfNs 266 N/CvGiNp 267 N/CvGiNs 268 N/CvGnNp 269 N/CvGnNs 270 N/CvG?Np 271 N/CvG?Ns 272 N/CvGpNp 273 N/CvGpNs 274 N/CvNp 275 NPRO/Ca 276 NPRO/CaGafinNp 277 NPRO/CaGaipNs 278 NPRO/CaGfNs 279 NPRO/CaGnNs 280 NPRO/CaGpNp 281 NPRO/CaGpNs 282 NPRO/CaNp 283 NPRO/CaNs 284 NPRO/Cd 285 NPRO/CdGafinNp 286 NPRO/CdGaipNs 287 NPRO/CdGfNs 288 NPRO/CdGnNs 289 NPRO/CdGpNp 290 NPRO/CdGpNs 291 NPRO/CdNp 292 NPRO/CdNs 293 NPRO/Cg 294 NPRO/CgGafinNp 295 NPRO/CgGaipNs 296 NPRO/CgGfNs 297 NPRO/CgGnNs 298 NPRO/CgGpNp 299 NPRO/CgGpNs 300 NPRO/CgNp 301 NPRO/CgNs 302 NPRO/Ci 303 NPRO/CiGafinNp 304 NPRO/CiGaipNs 305 NPRO/CiGfNs 306 NPRO/CiGnNs 307 NPRO/CiGpNp 308 NPRO/CiGpNs 309 NPRO/CiNp 310 NPRO/CiNs 311 NPRO/Cl 312 NPRO/ClGafinNp 313 NPRO/ClGaipNs 314 NPRO/ClGfNs 315 NPRO/ClGnNs 316 NPRO/ClGpNp 317 NPRO/ClGpNs 318 NPRO/ClNp 319 NPRO/ClNs 320 NPRO/CnGafinNp 321 NPRO/CnGaipNs 322 NPRO/CnGfNs 323 NPRO/CnGnNs 324 NPRO/CnGpNp 325 NPRO/CnGpNs 326 NPRO/CnNp 327 NPRO/CnNs 497 328 NUMCOL/Ca 498 329 NUMCOL/Cd … … 502 333 NUMCOL/Cn 503 334 NUMCRD/Ca 504 NUMCRD/CaGa ifn335 NUMCRD/CaGafin 505 336 NUMCRD/CaGain 506 337 NUMCRD/CaGf … … 509 340 NUMCRD/Cg 510 341 NUMCRD/Ci 342 NUMCRD/CiGainp 511 343 NUMCRD/CiGf 512 NUMCRD/CiGpain513 344 NUMCRD/Cl 514 345 NUMCRD/Cn 515 NUMCRD/CnGa ifn346 NUMCRD/CnGafin 516 347 NUMCRD/CnGain 517 348 NUMCRD/CnGf 518 349 NUMCRD/CnGp 519 NUMCRD/ZiCaGaifn 520 NUMCRD/ZiCaGain 521 NUMCRD/ZiCaGf 522 NUMCRD/ZiCaGp 523 NUMCRD/ZiCd 524 NUMCRD/ZiCg 525 NUMCRD/ZiCi 526 NUMCRD/ZiCiGf 527 NUMCRD/ZiCiGpain 528 NUMCRD/ZiCl 529 NUMCRD/ZiCnGaifn 530 NUMCRD/ZiCnGain 531 NUMCRD/ZiCnGf 532 NUMCRD/ZiCnGp 533 NUMCRD/ZqiCaGaifn 534 NUMCRD/ZqiCaGp 535 NUMCRD/ZqiCd 536 NUMCRD/ZqiCg 537 NUMCRD/ZqiCi 538 NUMCRD/ZqiCl 539 NUMCRD/ZqiCnGaifn 540 NUMCRD/ZqiCnGp 541 NUMORD/NpCaGp 542 NUMORD/NpCd 543 NUMORD/NpCgl 544 NUMORD/NpCi 545 NUMORD/NpCnavGaifn 546 NUMORD/NpCnvGp 547 NUMORD/NsCaGi 548 NUMORD/NsCaGpa 549 NUMORD/NsCaiGf 550 NUMORD/NsCavGf 551 NUMORD/NsCdGpain 552 NUMORD/NsCgdlGf 553 NUMORD/NsCgGpain 554 NUMORD/NsCilGpain 555 NUMORD/NsCnavGn 556 NUMORD/NsCnvGpai 350 NUMORD/CaGapNs 351 NUMORD/CaGiNs 352 NUMORD/CaGpNp 353 NUMORD/CaiGfNs 354 NUMORD/CanvGafinNp 355 NUMORD/CanvGnNs 356 NUMORD/CdGainpNs 357 NUMORD/CdglGfNs 358 NUMORD/CdNp 359 NUMORD/CgGainpNs 360 NUMORD/CglNp 361 NUMORD/CilGainpNs 362 NUMORD/CiNp 363 NUMORD/CnvGaipNs 364 NUMORD/CnvGfNs 365 NUMORD/CnvGpNp 557 366 NUMPAR 558 367 NUMPAR/Dc 559 368 NUMPAR/Dp 560 369 NUMPAR/Ds 370 NUMPAR/GainpNs 371 NUMPAR/GfNs 561 372 NUMPAR/Ns 562 NUMPAR/NsGf563 NUMPAR/NsGpain564 373 NV/Ca 565 374 NV/Cd … … 572 381 PART 573 382 P/Ca 383 P/Cag 384 P/Cagi 574 385 P/Cai 575 386 P/Cal 576 387 P/Cd 388 P/Cdg 577 389 P/Cg 578 P/Cga579 P/Cgai580 P/Cgd581 390 P/Cgi 582 P/Ci583 391 P/Cl 584 PPRO/Zp 392 PPRO/C 393 V/AiGafinMcNpP1Vp 394 V/AiGafinMcNpP2Vp 395 V/AiGafinMcNpP3Vp 396 V/AiGafinMdNpP1TaVp 397 V/AiGafinMdNpP2TaVp 398 V/AiGafinMdNpP3TaVp 399 V/AiGaipMcNsP1Vp 400 V/AiGaipMcNsP2Vp 401 V/AiGaipMcNsP3Vp 402 V/AiGaipMdNsP1TaVp 403 V/AiGaipMdNsP2TaVp 404 V/AiGaipMdNsP3TaVp 405 V/AiGfMcNsP1Vp 406 V/AiGfMcNsP2Vp 407 V/AiGfMcNsP3Vp 408 V/AiGfMdNsP1TaVp 409 V/AiGfMdNsP2TaVp 410 V/AiGfMdNsP3TaVp 411 V/AiGnMcNsP3Vp 412 V/AiGnMdNsP3TaVp 413 V/AiGpMcNpP1Vp 414 V/AiGpMcNpP2Vp 415 V/AiGpMcNpP3Vp 416 V/AiGpMdNpP1TaVp 417 V/AiGpMdNpP2TaVp 418 V/AiGpMdNpP3TaVp 419 V/AiMdNpP1TfrVp 420 V/AiMdNpP2TfrVp 421 V/AiMdNpP3TfrVp 422 V/AiMdNsP1TfrVp 423 V/AiMdNsP2TfrVp 424 V/AiMdNsP3TfrVp 425 V/AiMiNpP1Vp 426 V/AiMiNpP2Vp 427 V/AiMiNsP2Vp 428 V/AiTaVi 585 429 V/AiVb 586 V/A iViTa587 V/A iVpMcNpP1Gaifn588 V/A iVpMcNpP1Gp589 V/A iVpMcNpP2Gaifn590 V/A iVpMcNpP2Gp591 V/A iVpMcNpP3Gaifn592 V/A iVpMcNpP3Gp593 V/A iVpMcNsP1Gf594 V/A iVpMcNsP1Gpai595 V/A iVpMcNsP2Gf596 V/A iVpMcNsP2Gpai597 V/A iVpMcNsP3Gf598 V/A iVpMcNsP3Gn599 V/A iVpMcNsP3Gpai600 V/A iVpMdTaNpP1Gaifn601 V/A iVpMdTaNpP1Gp602 V/A iVpMdTaNpP2Gaifn603 V/A iVpMdTaNpP2Gp604 V/A iVpMdTaNpP3Gaifn605 V/A iVpMdTaNpP3Gp606 V/A iVpMdTaNsP1Gf607 V/A iVpMdTaNsP1Gpai608 V/A iVpMdTaNsP2Gf609 V/A iVpMdTaNsP2Gpai610 V/A iVpMdTaNsP3Gf611 V/A iVpMdTaNsP3Gn612 V/A iVpMdTaNsP3Gpai613 V/A iVpMdTrfNpP1614 V/A iVpMdTrfNpP2615 V/A iVpMdTrfNpP3616 V/A iVpMdTrfNsP1617 V/A iVpMdTrfNsP2618 V/A iVpMdTrfNsP3619 V/A iVpMiNpP1620 V/A iVpMiNpP2621 V/A iVpMiNsP2430 V/ApGafinMcNpP1Vp 431 V/ApGafinMcNpP2Vp 432 V/ApGafinMcNpP3Vp 433 V/ApGafinMdNpP1TaVp 434 V/ApGafinMdNpP2TaVp 435 V/ApGafinMdNpP3TaVp 436 V/ApGaipMcNsP1Vp 437 V/ApGaipMcNsP2Vp 438 V/ApGaipMcNsP3Vp 439 V/ApGaipMdNsP1TaVp 440 V/ApGaipMdNsP2TaVp 441 V/ApGaipMdNsP3TaVp 442 V/ApGfMcNsP1Vp 443 V/ApGfMcNsP2Vp 444 V/ApGfMcNsP3Vp 445 V/ApGfMdNsP1TaVp 446 V/ApGfMdNsP2TaVp 447 V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McNpP1Vp 468 V/GafinMcNpP2Vp 469 V/GafinMcNpP3Vp 470 V/GafinMdNpP1TaVp 471 V/GafinMdNpP2TaVp 472 V/GafinMdNpP3TaVp 473 V/GaipMcNsP1Vp 474 V/GaipMcNsP2Vp 475 V/GaipMcNsP3Vp 476 V/GaipMdNsP1TaVp 477 V/GaipMdNsP2TaVp 478 V/GaipMdNsP3TaVp 479 V/GfMcNsP1Vp 480 V/GfMcNsP2Vp 481 V/GfMcNsP3Vp 482 V/GfMdNsP1TaVp 483 V/GfMdNsP2TaVp 484 V/GfMdNsP3TaVp 485 V/GiMdNpP1TfrVp 486 V/GiMdNpP2TfrVp 487 V/GiMdNpP3TfrVp 488 V/GiMdNsP1TfrVp 489 V/GiMdNsP2TfrVp 490 V/GiMdNsP3TfrVp 491 V/GiMiNpP1Vp 492 V/GiMiNpP2Vp 493 V/GiMiNsP2Vp 494 V/GiTaVi 659 495 V/GiVb 660 V/GiViTa 661 V/GiVpMcNpP1Gaifn 662 V/GiVpMcNpP1Gp 663 V/GiVpMcNpP2Gaifn 664 V/GiVpMcNpP2Gp 665 V/GiVpMcNpP3Gaifn 666 V/GiVpMcNpP3Gp 667 V/GiVpMcNsP1Gf 668 V/GiVpMcNsP1Gpai 669 V/GiVpMcNsP2Gf 670 V/GiVpMcNsP2Gpai 671 V/GiVpMcNsP3Gf 672 V/GiVpMcNsP3Gn 673 V/GiVpMcNsP3Gpai 674 V/GiVpMdTaNpP1Gaifn 675 V/GiVpMdTaNpP1Gp 676 V/GiVpMdTaNpP2Gaifn 677 V/GiVpMdTaNpP2Gp 678 V/GiVpMdTaNpP3Gaifn 679 V/GiVpMdTaNpP3Gp 680 V/GiVpMdTaNsP1Gf 681 V/GiVpMdTaNsP1Gpai 682 V/GiVpMdTaNsP2Gf 683 V/GiVpMdTaNsP2Gpai 684 V/GiVpMdTaNsP3Gf 685 V/GiVpMdTaNsP3Gn 686 V/GiVpMdTaNsP3Gpai 687 V/GiVpMdTrfNpP1 688 V/GiVpMdTrfNpP2 689 V/GiVpMdTrfNpP3 690 V/GiVpMdTrfNsP1 691 V/GiVpMdTrfNsP2 692 V/GiVpMdTrfNsP3 693 V/GiVpMiNpP1 694 V/GiVpMiNpP2 695 V/GiVpMiNsP2 496 V/GnMcNsP3Vp 497 V/GnMdNsP3TaVp 498 V/GpMcNpP1Vp 499 V/GpMcNpP2Vp 500 V/GpMcNpP3Vp 501 V/GpMdNpP1TaVp 502 V/GpMdNpP2TaVp 503 V/GpMdNpP3TaVp 696 504 VNI -
src/compdic_utf8/Makefile
r5f4d9c3 re7de6cc 1 1 include ../../config.mak 2 2 3 all: comp iledic3 all: compdic 4 4 5 .PHONY: comp iledic5 .PHONY: compdic 6 6 compiledic: 7 7 … … 9 9 install: 10 10 ifdef BIN_DIR 11 install -m 0755 comp iledic $(BIN_DIR)11 install -m 0755 compdic $(BIN_DIR) 12 12 install -m 0755 text2fst.py $(BIN_DIR) 13 13 install -m 0755 symbols.py $(BIN_DIR) … … 17 17 uninstall: 18 18 ifdef BIN_DIR 19 rm $(BIN_DIR)/comp iledic19 rm $(BIN_DIR)/compdic 20 20 rm $(BIN_DIR)/text2fst.py 21 21 rm $(BIN_DIR)/symbols.py -
src/dgp/Makefile
r5f4d9c3 re7de6cc 1 1 2 include ../../config.mak 3 2 4 3 5 SHELL = /bin/sh … … 6 8 CMDLINE_FILE='"../dgp/cmdline.h"' 7 9 10 8 11 #vpath %.o . 9 12 10 ifeq ($(BUILD_STATIC), yes) 11 LDFLAGS += -static 12 endif 13 CXXFLAGS = -g -static 13 14 14 CXXFLAGS += -O2 15 16 sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp0.cc cmdline.cc \ 15 sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp1.cc cmdline.cc \ 17 16 $(COMMON_PATH)/common.cc global.cc 18 17 … … 23 22 24 23 ${bin}: ${objs} 25 $ (CXX) $(CXXFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs} $(LDFLAGS)24 ${CXX} ${CXXFLAGS} -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs} 26 25 27 26 include $(sources:.cc=.d) 28 27 29 28 %.o: %.cc 30 $ (CXX)-D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $<29 ${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $< 31 30 32 31 %.d: %.cc … … 35 34 rm -f $@.$$$$ 36 35 37 # stare: 38 # cmdline.cc cmdline.h : cmdline.ggo 39 # gengetopt --c-extension=cc -i cmdline.ggo 40 # nowe 36 41 37 cmdline.cc cmdline.h: cmdline.ggo 42 $(GENGETOPT)-i cmdline.ggo --c-extension=cc --conf-parser38 gengetopt -i cmdline.ggo --c-extension=cc --conf-parser 43 39 44 40 cmdline.ggo: cmdline_dgp.ggo ../common/cmdline_common.ggo 45 41 cat cmdline_dgp.ggo ../common/cmdline_common.ggo > cmdline.ggo 46 # endnowe47 42 48 43 44 45 .PHONY: clean 49 46 clean: 50 rm ${bin} ${objs} cmdline.cc cmdline.h51 rm - rf *.d47 rm -f ${bin} ${objs} cmdline.* 48 rm -f *.d 52 49 50 .PHONY: prof 53 51 prof: dgp 54 52 gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof 53 55 54 56 55 .PHONY: install … … 58 57 ifdef BIN_DIR 59 58 install -m 0755 dgp $(BIN_DIR) 60 install -m 0755 dgc $(BIN_DIR)61 install -m 0755 canonize $(BIN_DIR)62 install -m 0755 tre $(BIN_DIR)63 59 endif 64 60 … … 67 63 ifdef BIN_DIR 68 64 rm $(BIN_DIR)/dgp 69 rm $(BIN_DIR)/dgc70 rm $(BIN_DIR)/canonize71 rm $(BIN_DIR)/tre72 65 endif -
src/dgp/const.hh
r5f4d9c3 re7de6cc 3 3 4 4 #define MAXTYPES 32 5 #define MAXCATS 4096 5 6 #define MAXFLAGS 64 6 #define MAXNODES 1024 7 #define MAXPROPS 16 8 #define MAXNODES 2048 7 9 #define MAXCONSTRS 32 8 #define MAXLINE 25610 #define MAXLINE 512 9 11 #define MAXFORMLEN 64 10 12 #define MAXDESCRLEN 80 -
src/dgp/dgp0.cc
r5f4d9c3 re7de6cc 6 6 extern SGraph sgraph; 7 7 8 SNode* snodes;9 10 8 extern bool debug; 11 9 … … 16 14 void set_initial_constraints(int node) 17 15 { 18 s nodes[node].prop.forbidden.reset();19 s nodes[node].prop.required=grammar.obl[snodes[node].mnode->cat];16 sgraph[node].prop.forbidden.reset(); 17 sgraph[node].prop.required=grammar.is_obl(mgraph[sgraph[node].mnode].cat); 20 18 } 21 19 … … 23 21 bool changing_constraints(int head, Role role) 24 22 { 25 return grammar. sgl[role] || snodes[head].prop.required[role];23 return grammar.is_sgl(role) || sgraph[head].prop.required[role]; 26 24 } 27 25 28 26 void apply_constraints(int head, Role role) 29 27 { 30 if(grammar. sgl[role]) snodes[head].prop.forbidden.set(role);31 s nodes[head].prop.required.reset(role);28 if(grammar.is_sgl(role)) sgraph[head].prop.forbidden.set(role); 29 sgraph[head].prop.required.reset(role); 32 30 } 33 31 … … 35 33 { 36 34 NodeProp ret=headprop; 37 if(grammar. sgl[role]) ret.forbidden.set(role);35 if(grammar.is_sgl(role)) ret.forbidden.set(role); 38 36 ret.required.reset(role); 39 37 return ret; … … 44 42 NodeProp ret=headprop; 45 43 46 if(grammar. sgl[role]) ret.forbidden.set(role);44 if(grammar.is_sgl(role)) ret.forbidden.set(role); 47 45 ret.required.reset(role); 48 46 return ret; … … 52 50 { 53 51 for(vector<int>::iterator ps=mnode.snodes.begin(); ps!=mnode.snodes.end(); ++ps) 54 if(s nodes[*ps].prop==p && snodes[*ps].LH==newheadLH && snodes[*ps].LV==newheadLV)52 if(sgraph[*ps].prop==p && sgraph[*ps].LH==newheadLH && sgraph[*ps].LV==newheadLV) 55 53 return *ps; 56 54 return -1; … … 59 57 void connect_left(list<int>::iterator h, list<int>::iterator d, Role r) 60 58 { 61 NodeProp &oldheadprop = snodes[*h].prop; 62 NodeProp newheadprop; 63 bitset<MAXNODES> newheadLV; 64 bitset<MAXNODES> newheadLH; 65 bitset<MAXNODES> newheadLD; 66 67 newheadprop=compute_prop_left(oldheadprop,r); 59 NodeProp &oldheadprop = sgraph[*h].prop; 60 NodeProp newheadprop = compute_prop_left(oldheadprop,r); 68 61 69 62 int newheadind; … … 72 65 else 73 66 { 74 newheadLH = snodes[*h].LH;75 newheadLV = snodes[*d].LV;76 newheadLD = snodes[*h].LD;77 78 newheadind = get_node( *(snodes[*h].mnode), newheadprop, newheadLH, newheadLV);67 bitset<MAXNODES> newheadLH = sgraph[*h].LH; 68 bitset<MAXNODES> newheadLV = sgraph[*d].LV; 69 bitset<MAXNODES> newheadLD = sgraph[*h].LD; 70 71 newheadind = get_node(mgraph[sgraph[*h].mnode], newheadprop, newheadLH, newheadLV); 79 72 if( newheadind < 0 ) 80 73 { … … 82 75 list<int>::iterator nextit=h; ++nextit; 83 76 nodelist.insert(nextit,newheadind); 84 s nodes[newheadind].LH=newheadLH;85 s nodes[newheadind].in_LH=true;86 s nodes[newheadind].LV.reset();87 s nodes[newheadind].LD = newheadLD;77 sgraph[newheadind].LH=newheadLH; 78 sgraph[newheadind].LD = newheadLD; 79 sgraph[newheadind].in_LH=true; 80 sgraph[newheadind].LV.reset(); 88 81 89 82 if(debug) sgraph.print_node_debug(stderr," C ",newheadind); 90 83 } 91 84 else 92 s nodes[newheadind].LD |= newheadLD; // TYLKO DLA LD85 sgraph[newheadind].LD |= newheadLD; // TYLKO DLA LD 93 86 } 94 87 95 snodes[newheadind].deps.push_back(Arc(*d,r,*h)); 96 97 if(snodes[*d].saturated()) snodes[newheadind].LV |= snodes[*d].LV; 98 snodes[newheadind].LD.set(*d); 99 if(snodes[*d].saturated()) snodes[newheadind].LD |= snodes[*d].LD; 100 101 if(debug) 102 sgraph.print_arc(stderr,*d,newheadind,r,0), sgraph.print_node_debug(stderr," U ",newheadind); 103 } 104 88 sgraph[newheadind].deps.push_back(Arc(*d,r,*h)); 89 90 if(sgraph[*d].saturated()) sgraph[newheadind].LV |= sgraph[*d].LV; 91 92 sgraph[newheadind].LD.set(*d); 93 if(sgraph[*d].saturated()) sgraph[newheadind].LD |= sgraph[*d].LD; 94 95 if(debug) sgraph.print_arc(stderr,*d,newheadind,r,0), sgraph.print_node_debug(stderr," U ",newheadind); 96 } 105 97 106 98 void connect_right(list<int>::iterator h, list<int>::iterator d, Role r) 107 99 { 108 NodeProp &oldheadprop = snodes[*h].prop; 109 NodeProp newheadprop; 110 bitset<MAXNODES> newheadLV; 111 bitset<MAXNODES> newheadLH; 112 bitset<MAXNODES> newheadLD; 100 NodeProp &oldheadprop = sgraph[*h].prop; 101 NodeProp newheadprop = compute_prop_right(oldheadprop,r); 113 102 int newheadind; 114 103 115 newheadprop = compute_prop_right(oldheadprop,r);116 104 if(oldheadprop==newheadprop) 117 105 newheadind = *h; 118 106 else 119 107 { 120 newheadLH = snodes[*h].LH;121 newheadLV = snodes[*h].LV;122 newheadLD = snodes[*h].LD;123 124 newheadind = get_node( *(snodes[*h].mnode), newheadprop, newheadLH, newheadLV);108 bitset<MAXNODES> newheadLH = sgraph[*h].LH; 109 bitset<MAXNODES> newheadLV = sgraph[*h].LV; 110 bitset<MAXNODES> newheadLD = sgraph[*h].LD; 111 112 newheadind = get_node(mgraph[sgraph[*h].mnode], newheadprop, newheadLH, newheadLV); 125 113 if( newheadind < 0 ) 126 114 { 127 115 newheadind = sgraph.clone(*h,newheadprop); 128 snodes[newheadind].LH=newheadLH;129 snodes[newheadind].in_LH=false;130 snodes[newheadind].LV=newheadLV;131 snodes[newheadind].LD=newheadLD;132 116 list<int>::iterator nextit=h; ++nextit; 133 117 nodelist.insert(nextit,newheadind); 118 sgraph[newheadind].LH=newheadLH; 119 sgraph[newheadind].LD=newheadLD; 120 sgraph[newheadind].in_LH=false; 121 sgraph[newheadind].LV=newheadLV; 134 122 135 123 if(debug) sgraph.print_node_debug(stderr," C ",newheadind); 136 124 } 137 125 else 138 s nodes[newheadind].LD |= newheadLD; // TYLKO DLA LD126 sgraph[newheadind].LD |= newheadLD; // TYLKO DLA LD 139 127 } 140 128 141 snodes[*d].heads.push_back(Arc(newheadind,r,*h)); 142 143 snodes[*d].LH.set(newheadind); 144 145 if(snodes[newheadind].saturated()) snodes[*d].LH |= snodes[newheadind].LH; 146 147 if(debug) 148 sgraph.print_arc(stderr,newheadind,*d,r,1), sgraph.print_node_debug(stderr," U ",*d); 129 sgraph[*d].heads.push_back(Arc(newheadind,r,*h)); 130 131 sgraph[*d].LH.set(newheadind); 132 133 if(sgraph[newheadind].saturated()) sgraph[*d].LH |= sgraph[newheadind].LH; 134 135 if(debug) sgraph.print_arc(stderr,newheadind,*d,r,1), sgraph.print_node_debug(stderr," U ",*d); 149 136 150 137 } … … 156 143 if(sgraph.visible(*i,*j) && sgraph.saturated(*i)) 157 144 { 158 Roles& ji_roles = grammar.connect [snodes[*j].mnode->cat][snodes[*i].mnode->cat];145 Roles& ji_roles = grammar.connectable( mgraph[sgraph[*j].mnode].cat, mgraph[sgraph[*i].mnode].cat ); 159 146 for(RolesIter r=ji_roles.begin(); r!=ji_roles.end();++r) 160 if(grammar.check_constr(s nodes[*j].prop,snodes[*i].prop,0,*r))147 if(grammar.check_constr(sgraph[*j].prop,sgraph[*i].prop,0,*r)) 161 148 connect_left(j,i,*r); 162 149 } … … 169 156 if(sgraph.visible(*i,*j)) 170 157 { 171 Roles& ij_roles = grammar.connect [snodes[*i].mnode->cat][snodes[*j].mnode->cat];158 Roles& ij_roles = grammar.connectable( mgraph[sgraph[*i].mnode].cat, mgraph[sgraph[*j].mnode].cat ); 172 159 for(RolesIter r=ij_roles.begin(); r!=ij_roles.end();++r) 173 if(grammar.check_constr(s nodes[*i].prop,snodes[*j].prop,1,*r))160 if(grammar.check_constr(sgraph[*i].prop,sgraph[*j].prop,1,*r)) 174 161 connect_right(i,j,*r); 175 162 } … … 182 169 for(++i; i!=nodelist.end(); ++i) 183 170 { 184 for(vector<Arc>::iterator da=sgraph .nodes[*i].deps.begin()--; da!=sgraph.nodes[*i].deps.end(); ++da)185 sgraph .nodes[da->dst].heads.push_back(Arc(*i,da->role,da->anc));186 for(vector<Arc>::iterator ha=sgraph .nodes[*i].heads.begin(); ha!=sgraph.nodes[*i].heads.end(); ++ha)187 sgraph .nodes[ha->dst].deps.push_back(Arc(*i,ha->role,ha->anc));171 for(vector<Arc>::iterator da=sgraph[*i].deps.begin()--; da!=sgraph[*i].deps.end(); ++da) 172 sgraph[da->dst].heads.push_back(Arc(*i,da->role,da->anc)); 173 for(vector<Arc>::iterator ha=sgraph[*i].heads.begin(); ha!=sgraph[*i].heads.end(); ++ha) 174 sgraph[ha->dst].deps.push_back(Arc(*i,ha->role,ha->anc)); 188 175 } 189 176 } … … 192 179 void dgp0() 193 180 { 194 snodes=sgraph.nodes;195 181 196 182 nodelist.clear(); … … 198 184 processed=nodelist.begin(); 199 185 200 for(int m=0; m<mgraph. n; ++m)186 for(int m=0; m<mgraph.size() ; ++m) 201 187 { 202 int basenode = sgraph.add_base_snode(mgraph.nodes+m); // ma zwracaæ SNode* 188 int basenode = sgraph.add_base_snode(m); // ma zwracaæ SNode* 189 203 190 set_initial_constraints(basenode); 204 191 nodelist.push_back(basenode); … … 213 200 processed=cursor; 214 201 } 202 215 203 } 216 204 reverse_links(); -
src/dgp/grammar.cc
r5f4d9c3 re7de6cc 1 1 2 #include < stdio.h>2 #include <cstdio> 3 3 4 4 #include "grammar.hh" 5 5 6 bool (*constraint[MAXCONSTRS])(int head, int dep); 7 8 9 int chk_type(const char* s, int lineno) // SIDE EFECTS! 10 { 11 if(Role::index(s)>0) return 1; 12 13 fprintf(stderr,"%8d: Invalid type '%s'. Line ignored.\n",lineno,s); 14 return 0; 15 } 16 17 int chk_cat(const char* s, int lineno) 18 { 19 if(Cat::index(s)>0) return 1; 20 21 fprintf(stderr,"%8d: Invalid category '%s'. Line ignored.\n",lineno,s); 22 return 0; 23 } 6 //bool (*constraint[MAXCONSTRS])(int head, int dep); 7 8 //==================================================================================================== 9 //inline !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 10 bool chk_type(const char* s) { return Role::index(s)>0; } // PRZENIEŠÆ DO Role 11 //---------------------------------------------------------------------------------------------------- 12 //inline !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 13 bool chk_long(const char* s) { return LongRel::index(s)>0; } // jw 14 //---------------------------------------------------------------------------------------------------- 15 //inline !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 16 bool chk_cat(const char* s) { return Cat::index(s)>0; } //jw 17 //---------------------------------------------------------------------------------------------------- 18 //inline !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 19 bool chk_flag(const char* s) { return Flag::index(s)>0; } //jw 20 //==================================================================================================== 21 22 void grammar_error(int lineno, string s="Grammar error.") 23 { 24 fprintf(stderr,"%8d: %s Line ignored.\n",lineno,s.c_str()); 25 } 26 27 //==================================================================================================== 24 28 25 29 void Grammar::add_category(const char* s) 26 30 { 27 31 Cat::add(s); 28 if(Cat::count()>cats_sz) 32 33 if(connect.size() <= Cat::count()) 29 34 { 30 cats_sz += 16; 31 connect.resize(cats_sz); 32 for(int i=0; i<cats_sz; ++i) 33 connect[i].resize(cats_sz); 34 obl.resize(cats_sz); 35 connect.resize(Cat::count()+RESIZE_DELTA); 36 for(int i=0; i<connect.size(); ++i) 37 if(connect[i].size() <= Cat::count()) connect[i].resize(Cat::count()+RESIZE_DELTA); 35 38 } 39 if(connect1.size() <= Cat::count()) 40 { 41 connect1.resize(Cat::count()+RESIZE_DELTA); 42 for(int i=0; i<=connect1.size(); ++i) 43 if(connect1[i].size() <= Cat::count()) connect1[i].resize(Cat::count()+RESIZE_DELTA); 44 } 45 46 if(longrel.size() <= Cat::count()) 47 { 48 longrel.resize(Cat::count()+RESIZE_DELTA); 49 for(int i=0; i<longrel.size(); ++i) 50 if(longrel[i].size() <= Cat::count()) longrel[i].resize(Cat::count()+RESIZE_DELTA); 51 } 52 53 if(uptrigger.size() <= Cat::count()) 54 uptrigger.resize(Cat::count()+RESIZE_DELTA); 55 if(dntrigger.size() <= Cat::count()) 56 dntrigger.resize(Cat::count()+RESIZE_DELTA); 57 58 if(obl.size() <= Cat::count()) obl.resize(Cat::count()+RESIZE_DELTA); 59 if(set.size() <= Cat::count()) set.resize(Cat::count()+RESIZE_DELTA); 36 60 } 37 61 … … 39 63 { 40 64 Role::add(s); 41 if(Role::count()>types_sz) 42 { 43 types_sz += 16; 44 lt.resize(types_sz); 45 gt.resize(types_sz); 46 } 47 } 48 49 void Grammar::add_flag(const char* s) 50 { 51 Flag::add(s); 52 if(Flag::count()>flags_sz) 53 { 54 flags_sz += 16; 55 pass.resize(flags_sz); 56 } 57 } 58 65 66 if(lt.size() <= Role::count()) lt.resize(Role::count()+RESIZE_DELTA); 67 if(gt.size() <= Role::count()) gt.resize(Role::count()+RESIZE_DELTA); 68 if(pass.size() <= Role::count()) pass.resize(Role::count()+RESIZE_DELTA); 69 if(include.size() <= Role::count()) include.resize(Role::count()+RESIZE_DELTA); 70 if(exclude.size() <= Role::count()) exclude.resize(Role::count()+RESIZE_DELTA); 71 for(int i=0; i<uptrigger.size(); i++) 72 if(uptrigger[i].size() <= Role::count()) uptrigger[i].resize(Role::count()+RESIZE_DELTA); 73 for(int i=0; i<dntrigger.size(); i++) 74 if(dntrigger[i].size() <= Role::count()) dntrigger[i].resize(Role::count()+RESIZE_DELTA); 75 } 76 77 //==================================================================================================== 78 79 bool Grammar::contains_boubble(const list<Boubble*> boubble_list, Boubble* bp) const 80 { 81 for(list<Boubble*>::const_iterator bi = boubble_list.begin(); bi != boubble_list.end(); bi++ ) 82 if(**bi == *bp) return true; 83 return false; 84 } 85 86 //---------------------------------------------------------------------------------------------------- 87 88 void Grammar::add_triggers(Cat src, Cat dest, LongRel l) 89 { 90 for(list<Boubble*>::const_iterator b=boubbles.begin(); b!=boubbles.end(); b++) 91 if((*b)->rel() == l) 92 { 93 list<Boubble*>& boubble_list = ((*b)->dir()==UP) ? uptrigger[src][(*b)->next()] : dntrigger[src][(*b)->next()] ; 94 if(!contains_boubble(boubble_list,*b)) 95 boubble_list.push_back(*b); 96 } 97 } 98 99 //==================================================================================================== 59 100 60 101 void Grammar::set_lt(Role s, Role t) … … 85 126 86 127 128 void Grammar::compute_triggers() 129 { 130 //init uptrigger array 131 uptrigger.resize(Cat::count()); 132 for(int i=0; i<uptrigger.size(); i++) 133 uptrigger[i].resize(Role::count()); 134 //init dntrigger array 135 dntrigger.resize(Cat::count()); 136 for(int i=0; i<dntrigger.size(); i++) 137 dntrigger[i].resize(Role::count()); 138 139 // for(int c=0; c<Cat::count(); c++) 140 // for(int r=0; r<Role::count(); r++) 141 // for(list<Boubble>::const_iterator b=boubbles.begin(); b!=boubbles.end; b++) 142 // if(b->dir()==UP && ) 143 } 144 145 //==================================================================================================== 146 147 list<Boubble*> Grammar::trigger_boubbles(Cat c, Role r, Dir d) 148 { 149 list<Boubble*> boubble_list = (d == UP) ? uptrigger[c][r] : dntrigger[c][r]; 150 list<Boubble*> ret; 151 for(list<Boubble*>::iterator b = boubble_list.begin(); b != boubble_list.end(); ++b) 152 ret.push_back((*b)->step(r,d)); 153 return ret; 154 } 155 156 //==================================================================================================== 157 158 Flag parse_flags(const char* s, const char* v) 159 { 160 char buf[16][17]; 161 int n=sscanf(s,"%[A-Z]%[+-]%[A-Z]%[+-]%[A-Z]%[+-]%[A-Z]%[+-]%[A-Z]%[+-]%[A-Z]%[+-]%[A-Z]%[+-]%[A-Z]%[+-]", 162 buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7],buf[8],buf[9],buf[10],buf[11],buf[12],buf[13],buf[14],buf[15],buf[16]); 163 for(int i=2; i<=n; i+=2) 164 if(strcmp(buf[i-1],v)==0) 165 return Flag(buf[i-2]); 166 return Flag("NULL"); 167 } 168 169 170 PropSet parse_props(const char* s) 171 { 172 PropSet ret; 173 char buf[8][17]; 174 int n=sscanf(s,"&%[A-Z]&%[A-Z]&%[A-Z]&%[A-Z]&%[A-Z]&%[A-Z]&%[A-Z]&%[A-Z]",buf[0],buf[1],buf[2],buf[3],buf[4],buf[5],buf[6],buf[7]); 175 for(int i=1; i<=n; i++) 176 ret.set(Prop(buf[i-1])); 177 return ret; 178 179 } 180 181 87 182 bool Grammar::read(FILE* f) 88 183 { 184 185 //>>> TU? 186 187 Prop::add("INIT"); 188 Prop::add("FIN"); 189 190 //<<< TU? 191 192 89 193 int lineno=0; 90 194 char line[MAXLINE]; // line has the structure: key [arg1 [arg2 [arg3]]] … … 93 197 char arg2[MAXLINE]; 94 198 char arg3[MAXLINE]; 199 char arg4[MAXLINE]; 95 200 96 201 while(fgets(line,MAXLINE,f)) 97 {98 lineno++;99 int fields=sscanf(line,"%s %s %s %s",key,arg1,arg2,arg3);100 101 if(fields<1 || key[0]=='#') continue; // skip empty lines and comments102 103 if (strcmp(key,"CAT")==0 && fields>=2)104 202 { 105 add_category(arg1); 203 lineno++; 204 int fields=sscanf(line,"%s %s %s %s %s",key,arg1,arg2,arg3,arg4); 205 206 if(fields<1 || key[0]=='#') continue; // skip empty lines and comments 207 208 if(fields>1 && arg1[0] == '#') fields=1; 209 if(fields>2 && arg2[0] == '#') fields=2; 210 if(fields>3 && arg3[0] == '#') fields=3; 211 if(fields>4 && arg4[0] == '#') fields=4; 212 213 if (strcmp(key,"CAT")==0 && fields==2) 214 { 215 add_category(arg1); 216 } 217 else if(strcmp(key,"ROLE")==0 && fields==2) 218 { 219 add_type(arg1); 220 } 221 else if(strcmp(key,"SGL")==0 && fields==2) 222 { 223 if(chk_type(arg1)) 224 set_sgl(arg1); 225 else 226 grammar_error(lineno); 227 } 228 else if(strcmp(key,"LEFT")==0 && fields==2) 229 { 230 if(chk_type(arg1)) 231 set_left(arg1); 232 else 233 grammar_error(lineno); 234 } 235 else if(strcmp(key,"RIGHT")==0 && fields==2) 236 { 237 if(chk_type(arg1)) 238 set_right(arg1); 239 else 240 grammar_error(lineno); 241 } 242 else if(strcmp(key,"INITR")==0 && fields==2) 243 { 244 if(chk_type(arg1)) 245 set_init(arg1); 246 else 247 grammar_error(lineno); 248 } 249 else if(strcmp(key,"FINR")==0 && fields==2) 250 { 251 if(chk_type(arg1)) 252 set_fin(arg1); 253 else 254 grammar_error(lineno); 255 } 256 else if(strcmp(key,"INITF")==0 && fields==2) 257 { 258 if(chk_flag(arg1)) 259 set_initf(arg1); 260 else 261 grammar_error(lineno); 262 } 263 else if(strcmp(key,"FINF")==0 && fields==2) 264 { 265 if(chk_flag(arg1)) 266 set_finf(arg1); 267 else 268 grammar_error(lineno); 269 } 270 else if(strcmp(key,"REQ")==0 && fields==3) 271 { 272 if( chk_cat(arg1) && chk_type(arg2) ) 273 set_obl(arg1,arg2); 274 else 275 grammar_error(lineno); 276 } 277 else if(strcmp(key,"CONSTRE")==0 && fields==3) 278 { 279 if( chk_type(arg1) && chk_type(arg2) ) 280 set_exclude(arg1,arg2); 281 else 282 grammar_error(lineno); 283 } 284 else if(strcmp(key,"CONSTRI")==0 && fields==3) 285 { 286 if( chk_type(arg1) && chk_type(arg2) ) 287 set_include(arg1,arg2); 288 else 289 grammar_error(lineno); 290 } 291 else if(strcmp(key,"LONG")==0 && fields ==3) 292 { 293 add_long(arg1,arg2); 294 } 295 else if(strcmp(key,"LINK")==0 && fields==4) 296 { 297 char cat1[MAXLINE],flags1[MAXLINE],cat2[MAXLINE],flags2[MAXLINE],type[MAXLINE],props[MAXLINE]; 298 299 if(sscanf(arg1,"%[^;];%s",cat1,flags1)==1) *flags1='\0'; 300 if(sscanf(arg2,"%[^;];%s",cat2,flags2)==1) *flags2='\0'; 301 if(sscanf(arg3,"%[^&]%s",type,props)==1) *props='\0'; 302 303 // printf("line=%s\n\tcat1=%s flags1=%s cat2=%s flags2=%s type=%s props=%s\n",line,cat1,flags1,cat2,flags2,type,props); 304 305 if( chk_cat(cat1) && chk_cat(cat2) && chk_type(type) ) 306 set_connect(cat1,parse_flags(flags1,"+"),parse_flags(flags1,"-"),cat2,parse_flags(flags2,"+"),parse_flags(flags2,"-"),type,parse_props(props)); 307 else if( chk_cat(cat1) && chk_cat(cat2) && chk_long(type) ) 308 { 309 set_longrel(cat1,cat2,type); 310 add_triggers(cat1,cat2,type); 311 } 312 else 313 grammar_error(lineno); 314 } 315 // else if(strcmp(key,"LINK")==0 && fields==5) 316 // { 317 // if( chk_cat(arg1) && chk_cat(arg2) && chk_type(arg4) ) 318 // set_connect(arg1,arg2,arg3,arg4); 319 // else 320 // grammar_error(lineno); 321 // } 322 // FLAG DECLARATION 323 else if(strcmp(key,"FLAG")==0 && fields==2) 324 { 325 add_flag(arg1); 326 } 327 else if(strcmp(key,"SET")==0 && fields==3) 328 { 329 if( chk_cat(arg1) && chk_flag(arg2) ) 330 set_set(arg1,arg2); 331 else 332 grammar_error(lineno); 333 } 334 else if(strcmp(key,"PASS")==0 && fields==3) 335 { 336 if( chk_type(arg1) && chk_flag(arg2) ) 337 set_pass(arg1,arg2); 338 else 339 grammar_error(lineno); 340 } 341 342 else fprintf(stderr,"Statement not recognized in line %d. Ignored.\n", lineno); 106 343 } 107 else if(strcmp(key,"ROLE")==0 && fields>=2) 108 { 109 add_type(arg1); 110 } 111 else if(strcmp(key,"SGL")==0 && fields>=2) 112 { 113 if(chk_type(arg1,lineno)) 114 set_sgl(arg1); 115 } 116 else if(strcmp(key,"LEFT")==0 && fields>=2) 117 { 118 if(chk_type(arg1,lineno)) 119 set_left(arg1); 120 } 121 else if(strcmp(key,"RIGHT")==0 && fields>=2) 122 { 123 if(chk_type(arg1,lineno)) 124 set_right(arg1); 125 } 126 else if(strcmp(key,"REQ")==0 && fields>=3) 127 { 128 if(chk_cat(arg1,lineno) + chk_type(arg2,lineno) == 2) 129 set_obl(arg1,arg2); 130 } 131 else if(strcmp(key,"LINK")==0 && fields>=4) 132 { 133 if(chk_cat(arg1,lineno) + chk_cat(arg2,lineno) + chk_type(arg3,lineno) == 3) 134 set_connect(arg1,arg2,arg3); 135 } 136 // FLAG DECLARATION 137 else if(strcmp(key,"FLAG")==0 && fields>=2) 138 { 139 add_flag(arg1); 140 } 141 142 else fprintf(stderr,"Invalid line %d. Ignored.\n", lineno); 143 } 144 145 // compute_gt(); 146 344 345 // compute_gt(); 346 147 347 return true; 148 348 149 349 } 350 351 352 void Grammar::write(ostream& os) 353 { 354 for(Cat i=1; i<Cat::count(); ++i) 355 os << "CAT\t" << i.str() << endl; 356 357 for(Role i=1; i<Role::count(); ++i) 358 os << "ROLE\t" << i.str() << endl; 359 360 for(Role i=1; i<Role::count(); ++i) 361 if(sgl.test(i)) 362 os << "SGL\t" << i.str() << endl; 363 364 for(Role i=1; i<Role::count(); ++i) 365 if(left.test(i)) 366 os << "LEFT\t" << i.str() << endl; 367 368 for(Role i=1; i<Role::count(); ++i) 369 if(right.test(i)) 370 os << "RIGHT\t" << i.str() << endl; 371 372 for(Cat c=1; c<Cat::count(); ++c) 373 for(Role r=1; r<Role::count(); ++r) 374 if(obl[c].test(r)) 375 os << "REQ\t" << c.str() << "\t" << r.str() << endl; 376 377 for(Cat c=1; c<Cat::count(); ++c) 378 for(Cat d=1; d<Cat::count(); ++d) 379 for(Links::const_iterator l = connect1[c][d].begin(); l != connect1[c][d].end(); l++) 380 { 381 os << "LINK\t" << c.str(); 382 if(l->hflagplus||l->hflagminus) 383 { 384 os << ";"; 385 if(l->hflagplus) os << (l->hflagplus).str() << "+"; 386 if(l->hflagminus) os << (l->hflagminus).str() << "-"; 387 } 388 os << "\t" << d.str(); 389 if(l->dflagplus||l->dflagminus) 390 { 391 os << ";"; 392 if(l->dflagplus) os << (l->dflagplus).str() << "+"; 393 if(l->dflagminus) os << (l->dflagminus).str() << "-"; 394 } 395 os << "\t" << (l->role).str(); 396 for(Prop p=0; p<Prop::count(); ++p) 397 if(l->props[p]) 398 os << "&" << p.str(); 399 os << endl; 400 } 401 402 for(LongRel i=1; i<LongRel::count(); ++i) 403 os << "LONG\t" << i.str() << endl; 404 405 for(list<Boubble*>::const_iterator b = boubbles.begin(); b != boubbles.end(); b++) 406 os << "BOUBBLE\t" << **b << endl; 407 408 for(Cat c=1; c<Cat::count(); ++c) 409 for(Cat d=1; d<Cat::count(); ++d) 410 for(LongRel l=1; l<LongRel::count(); ++l) 411 if(longrel[c][d].count(l)) 412 os << "LLINK\t" << c.str() << "\t" << d.str() << "\t" << l.str() << endl; 413 414 for(Cat c=1; c<Cat::count(); ++c) 415 for(Flag f=1; f<Flag::count(); ++f) 416 if(set[c].test(f)) 417 os << "SET\t" << c.str() << "\t" << f.str() << endl; 418 419 for(Role r=1; r<Role::count(); ++r) 420 for(Flag f=1; f<Flag::count(); ++f) 421 if(pass[r].test(f)) 422 os << "PASS\t" << r.str() << "\t" << f.str() << endl; 423 424 for(Role r=1; r<Role::count(); ++r) 425 for(Role t=1; t<Role::count(); ++t) 426 if(include[r].test(t)) 427 os << "CONSTRI\t" << r.str() << "\t" << t.str() << endl; 428 429 for(Role r=1; r<Role::count(); ++r) 430 for(Role t=1; t<Role::count(); ++t) 431 if(exclude[r].test(t)) 432 os << "CONSTRE\t" << r.str() << "\t" << t.str() << endl; 433 434 for(Cat c=1; c<Cat::count(); ++c) 435 for(Role r=1; r<Role::count(); ++r) 436 for(list<Boubble*>::const_iterator b=uptrigger[c][r].begin(); b!=uptrigger[c][r].end(); b++) 437 os << "TRIGGER-UP\t" << c.str() << "\t" << r.str() << "\t" << (*b)->rel().str() << endl; 438 439 for(Cat c=1; c<Cat::count(); ++c) 440 for(Role r=1; r<Role::count(); ++r) 441 for(list<Boubble*>::const_iterator b=dntrigger[c][r].begin(); b!=dntrigger[c][r].end(); b++) 442 os << "TRIGGER-DN\t" << c.str() << "\t" << r.str() << "\t" << (*b)->rel().str() << endl; 443 444 for(Flag i=1; i<Flag::count(); ++i) 445 os << "FLAG\t" << i.str() << endl; 446 } 447 448 449 450 451 452 453 454 455 456 //================================= OLD 150 457 151 458 void Grammar::write(FILE* f) … … 155 462 156 463 for(Role i=1; i<Role::count(); ++i) 157 fprintf(f,"ROLE\t%s \n",i.str());464 fprintf(f,"ROLE\t%s (%d)(%d)\n",i.str(),Role::index(i.str()),chk_type(i.str())); 158 465 159 466 for(Role i=1; i<Role::count(); ++i) … … 176 483 fprintf(f,"LINK\t%s\t%s\t%s\n",c.str(),d.str(),t.str()); 177 484 485 for(LongRel i=1; i<LongRel::count(); ++i) 486 fprintf(f,"LONG\t%s\n",i.str()); 487 488 for(Cat c=1; c<Cat::count(); ++c) 489 for(Cat d=1; d<Cat::count(); ++d) 490 for(LongRel l=1; l<LongRel::count(); ++l) 491 if(longrel[c][d].count(l)) 492 fprintf(f,"LLINK\t%s\t%s\t%s\n",c.str(),d.str(),l.str()); 493 494 for(Cat c=1; c<Cat::count(); ++c) 495 for(Role r=1; r<Role::count(); ++r) 496 for(list<Boubble*>::const_iterator b=uptrigger[c][r].begin(); b!=uptrigger[c][r].end(); b++) 497 fprintf(f,"#TRIGGER\t%s\t%s\t%s\n",c.str(),r.str(),(*b)->rel().str()); 498 499 for(Cat c=1; c<Cat::count(); ++c) 500 for(Role r=1; r<Role::count(); ++r) 501 for(list<Boubble*>::const_iterator b=dntrigger[c][r].begin(); b!=dntrigger[c][r].end(); b++) 502 fprintf(f,"#TRIGGER\t%s\t%s\t%s\n",c.str(),r.str(),(*b)->rel().str()); 503 178 504 for(Flag i=1; i<Flag::count(); ++i) 179 505 fprintf(f,"FLAG\t%s\n",i.str()); 180 506 } 181 -
src/dgp/grammar.hh
r5f4d9c3 re7de6cc 10 10 #include "thesymbols.hh" 11 11 #include "sgraph.hh" 12 13 14 class Link 15 { 12 #include "boubble.hh" 13 14 using namespace std; 15 16 //enum PROP { INIT=0, FIN=1 }; 17 //typedef bitset<16> PropSet; 18 19 const PropSet EmptyPropSet = PropSet(); 20 21 const FlagSet EmptyFlagSet = FlagSet(); 22 23 //==================================================================================================== 24 // class Link 25 //==================================================================================================== 26 27 struct Link 28 { 29 Link(Role r, Flag dfplus="NULL", Flag dfminus="NULL") : role(r), dflagplus(dfplus), dflagminus(dfminus) { } 30 Link(Role r, PropSet ps=EmptyPropSet, Flag hfp="NULL", Flag hfm="NULL", Flag dfp="NULL", Flag dfm="NULL") 31 : role(r), props(ps), hflagplus(hfp), hflagminus(hfm), dflagplus(dfp), dflagminus(dfm) { } 32 //Link(Role r) : role(r), dflagplus("NULL") { } 33 16 34 Role role; 17 FlagSet hflags; 18 FlagSet dflags; 35 Flag hflagplus; 36 Flag hflagminus; 37 Flag dflagplus; 38 Flag dflagminus; 39 PropSet props; 40 41 bool operator<(const Link& l) const 42 { 43 if(role < l.role) return true; 44 if(hflagplus < l.hflagplus) return true; 45 if(hflagminus < l.hflagminus) return true; 46 if(dflagplus < l.dflagplus) return true; 47 if(dflagminus < l.dflagminus) return true; 48 if(props.to_ulong() < l.props.to_ulong()) return true; 49 return false; 50 } 51 19 52 }; 20 53 54 typedef set<Link> Links; 55 56 //==================================================================================================== 57 // class Grammar 58 //==================================================================================================== 21 59 22 60 class Grammar … … 25 63 public: 26 64 27 // enum CONSTR { SGL, OBL, LEFT, RIGHT, INIT, NONINIT, FIN, NONFIN }; 28 29 Grammar() : types_sz(0), cats_sz(0), flags_sz(0) {} ; 65 static const int RESIZE_DELTA=16; 66 67 Grammar() {} ; 68 69 Roles& connectable(Cat h, Cat d); 70 Roles connectable(Cat h, Cat d, FlagSet f, FlagSet df); 71 72 list<const Link*> connectable2(Cat h, Cat d, FlagSet hfs, FlagSet dfs); 73 74 bool check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role); 75 bool check_constr2(NodeProp& hprop, NodeProp& dprop, int dir, const Link& link); 76 77 bool check_longrel(Cat hcat, Cat dcat, LongRel rel); 78 bool is_sgl(Role r); 79 RoleSet is_obl(Cat c); 80 81 RoleSet& constr_include(Role r) { return include[r]; }; 82 RoleSet& constr_exclude(Role r) { return exclude[r]; }; 30 83 31 int types_sz; 32 int cats_sz; 33 int flags_sz; 34 35 vector< vector< Roles > > connect; 84 FlagSet initial_flags(Cat c) { return set[c]; } 85 FlagSet pass_flags(Role r) { return pass[r]; } 86 87 list<Boubble*> trigger_boubbles(Cat c, Role r, Dir d); 88 89 bool read(FILE* f); 90 void write(ostream& os); 91 void write(FILE* f); 92 93 private: 94 36 95 RoleSet sgl; 37 vector< RoleSet > obl; 96 vector< RoleSet > obl; //[Cat] 38 97 RoleSet left; 39 98 RoleSet right; 40 vector< RoleSet > lt; 41 vector< RoleSet > gt; 42 43 44 // vector< vector< vector< 45 vector< FlagSet > set; 46 vector< FlagSet > pass; 47 48 bool read(FILE* f); 49 void write(FILE* f); 99 RoleSet init; 100 RoleSet fin; 101 FlagSet initf; 102 FlagSet finf; 103 104 vector< RoleSet > lt; //[Role] 105 vector< RoleSet > gt; //[Role] 106 107 vector< FlagSet > set; //[Cat] 108 // vector< FlagSet > rset; //[Role] 109 vector< FlagSet > pass; //[Role] 110 111 vector< vector< Roles > > connect; //[Cat][Cat] 112 113 vector< vector< Links > > connect1; //[Cat][Cat] 114 115 vector< RoleSet > include; //[Role] 116 vector< RoleSet > exclude; //[Role] 117 118 vector< vector< LongRels > > longrel; //[Cat][Cat] 119 120 list< Boubble* > boubbles; 121 122 vector< vector< list<Boubble*> > > uptrigger;//[Cat][Role] 123 vector< vector< list<Boubble*> > > dntrigger;//[Cat][Role] 50 124 51 125 void add_category(const char* s); 52 126 void add_type(const char* s); 53 void add_flag(const char* s); 54 55 void set_sgl(Role r) { sgl.set(r); } 56 void set_obl(Cat c, Role r) { obl[c].set(r); } 57 void set_left(Role r) { left.set(r); } 58 void set_right(Role r) { right.set(r); } 59 void set_order(Role r, Role s) { lt[s].set(r); } 60 void set_connect(Cat c, Cat d, Role r) { connect[c][d].insert(r); } 127 void add_flag(const char* s) { Flag::add(s); } 128 void add_long(const char* l, const char* p) { LongRel::add(l); boubbles.push_back( new Boubble(p,l) ); } 129 void add_triggers(Cat h, Cat d, LongRel l); 130 131 void set_sgl(Role r) { sgl.set(r); } 132 void set_obl(Cat c, Role r) { obl[c].set(r); } 133 void set_left(Role r) { left.set(r); } 134 void set_right(Role r) { right.set(r); } 135 void set_init(Role r) { init.set(r); } 136 void set_fin(Role r) { fin.set(r); } 137 void set_initf(Flag f) { initf.set(f); } 138 void set_finf(Flag f) { finf.set(f); } 139 void set_order(Role r, Role s) { lt[s].set(r); } 140 141 // void set_connect(Cat c, Cat d, Role r) { connect[c][d].insert(r); } 142 // void set_connect(Cat c, Cat d, Flag f, Role r) { connect1[c][d].insert(Link(r,f)); } 143 144 void set_connect(Cat h, Flag hfp, Flag hfm, Cat d, Flag dfp, Flag dfm, Role r, PropSet ps ) { connect1[h][d].insert(Link(r,ps,hfp,hfm,dfp,dfm)); } 145 146 void set_include(Role r, Role s) { include[r].set(s); } 147 void set_exclude(Role r, Role s) { exclude[r].set(s); } 148 void set_longrel(Cat c, Cat d, LongRel l){ longrel[c][d].insert(l); } 149 void set_set(Cat c, Flag f) { set[c].set(f); } 150 void set_pass(Role r, Flag f) { pass[r].set(f); } 61 151 void set_lt(Role r, Role s); 62 152 void compute_gt(); 63 64 65 bool check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role); 153 void compute_triggers(); 154 bool contains_boubble(const list<Boubble*> boubble_list, Boubble* bp) const; 66 155 67 156 }; 68 157 69 inline bool Grammar::check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role) 158 //---------------------------------------------------------------------------------------------------- 159 160 inline 161 Roles& Grammar::connectable(Cat h, Cat d) 162 { 163 return connect[h][d]; 164 } 165 166 //---------------------------------------------------------------------------------------------------- 167 168 inline 169 Roles Grammar::connectable(Cat h, Cat d, FlagSet hfs, FlagSet dfs) // ZBYT WOLNE!!!!!!!!!!!!!!!!!!!!!!!!!! (-> Roles&) 170 { 171 Roles ret; 172 for(Links::const_iterator l = connect1[h][d].begin(); l != connect1[h][d].end(); l++) 173 if( (l->hflagplus==0 || hfs[l->hflagplus]) && (l->hflagminus==0 || !hfs[l->hflagminus]) ) 174 if( (l->dflagplus==0 || dfs[l->dflagplus]) && (l->dflagminus==0 || !dfs[l->dflagminus]) ) 175 ret.insert(l->role); 176 return ret; 177 } 178 179 //---------------------------------------------------------------------------------------------------- 180 181 inline 182 list<const Link*> Grammar::connectable2(Cat h, Cat d, FlagSet hfs, FlagSet dfs) // ZBYT WOLNE!!!!!!!!!!!!!!!!!!!!!!!!!! (-> Roles&) 183 { 184 list<const Link*> ret; 185 for(Links::const_iterator l = connect1[h][d].begin(); l != connect1[h][d].end(); l++) 186 if( (l->hflagplus==0 || hfs[l->hflagplus]) && (l->hflagminus==0 || !hfs[l->hflagminus]) ) 187 if( (l->dflagplus==0 || dfs[l->dflagplus]) && (l->dflagminus==0 || !dfs[l->dflagminus]) ) 188 ret.push_back(&(*l)); 189 return ret; 190 } 191 192 //---------------------------------------------------------------------------------------------------- 193 194 inline 195 bool Grammar::check_constr(NodeProp& hprop, NodeProp& dprop, int dir, Role role) // dir: 0-left 1-right 70 196 { 71 197 return 72 198 !hprop.forbidden[role] && 73 ( !right[role] || dir==1 ) && 74 ( !left[role] || dir==0 ) 199 ( dir==1 || !right[role] ) && 200 ( dir==0 || !left[role] ) && 201 ( dir==1 || (hprop.attached&init).none() ) && 202 ( dir==0 || (hprop.attached&fin).none() ) 75 203 ; 76 204 } 77 205 206 //---------------------------------------------------------------------------------------------------- 207 208 inline 209 bool Grammar::check_constr2(NodeProp& hprop, NodeProp& dprop, int dir, const Link& link) // dir: 0-left 1-right 210 { 211 return 212 !hprop.forbidden[link.role] && 213 ( dir==1 || !right[link.role] ) && 214 ( dir==0 || !left[link.role] ) && 215 ( dir!=0 || !hprop.init_attached ) && 216 ( dir!=1 || !hprop.fin_attached ) 217 ; 218 } 219 220 //---------------------------------------------------------------------------------------------------- 221 222 inline 223 bool Grammar::check_longrel(Cat hcat, Cat dcat, LongRel rel) 224 { 225 return longrel[hcat][dcat].find(rel) != longrel[hcat][dcat].end(); 226 } 227 228 //---------------------------------------------------------------------------------------------------- 229 230 inline bool Grammar::is_sgl(Role r) 231 { 232 return sgl[r]; 233 } 234 235 //---------------------------------------------------------------------------------------------------- 236 237 inline RoleSet Grammar::is_obl(Cat c) 238 { 239 return obl[c]; 240 } 241 242 //==================================================================================================== 78 243 79 244 #endif -
src/dgp/main.cc
r5f4d9c3 re7de6cc 11 11 #include "sgraph.hh" 12 12 #include "grammar.hh" 13 #include "dgp 0.hh"13 #include "dgp1.hh" 14 14 #include "../common/common.h" 15 15 #include "cmdline.h" … … 25 25 Grammar grammar; 26 26 MGraph mgraph; 27 SGraph sgraph ;27 SGraph sgraph(mgraph); 28 28 29 29 FILE* grammarf; … … 65 65 fclose(grammarf); 66 66 67 68 69 // grammar.write(cout); 70 // exit(0); 71 72 73 67 74 mgraph.clear(); 68 75 sgraph.clear(); … … 83 90 if(strcmp(segtype,"EOS")==0) 84 91 { 85 dgp 0(); // parametry!!! MGraph, SGraph, Grammar92 dgp1(); // parametry!!! MGraph, SGraph, Grammar 86 93 output(); 87 94 … … 105 112 if(seg_mnode[si]>=0) 106 113 { 107 MNode& m=mgraph .nodes[seg_mnode[si]];114 MNode& m=mgraph[seg_mnode[si]]; 108 115 for(vector<int>::iterator s=m.snodes.begin(); s!=m.snodes.end(); ++s) 109 116 { -
src/dgp/mgraph.cc
r5f4d9c3 re7de6cc 4 4 #include "const.hh" 5 5 6 #include < stdio.h>6 #include <cstdio> 7 7 8 8 int MGraph::add_node(char* seg) 9 9 { 10 nodes[n].clear(); 10 MNode newnode; 11 newnode.clear(); 11 12 12 char field1[80], field3[80], descr[256], gph[256];13 char field1[80], field3[80], field4[256], descr[256], gph[256]; 13 14 char* cat; 14 15 15 16 getfield(seg,"1",field1); 16 n odes[n].pos=atoi(field1);17 newnode.pos=atoi(field1); 17 18 18 19 getfield(seg,"3",field3); 20 21 getfield(seg,"4",field4); 22 strcpy(newnode.form,field4); 23 19 24 if(!getfield(seg,"lem",descr)) strcpy(descr,"?,?"); 20 25 … … 23 28 if(*cat) ++cat; 24 29 25 // Cat::add(cat);26 30 if(Cat::index(cat)>0) 27 n odes[n].cat=cat;31 newnode.cat=cat; 28 32 else 29 n odes[n].cat="NULL";33 newnode.cat="NULL"; 30 34 31 n odes[n].pred.clear();35 newnode.pred.clear(); 32 36 33 37 char* tok; … … 41 45 42 46 char* ids=strtok(gph,":"); 43 if( n!=atoi(ids)){fprintf(stderr,"Invalid node id in line ?. Program aborted.\n"); exit(1); }47 if(size() != atoi(ids)) {fprintf(stderr,"Invalid node id in line ?. Program aborted.\n"); exit(1); } 44 48 45 49 char *preds; … … 47 51 { 48 52 previd=atoi(preds); 49 n odes[n].pred.push_back(&nodes[previd]);53 newnode.pred.push_back(previd); 50 54 } 51 55 52 return n++; 56 nodes.push_back(newnode); 57 return nodes.size()-1; 53 58 } 54 59 -
src/dgp/mgraph.hh
r5f4d9c3 re7de6cc 8 8 #include "../common/common.h" 9 9 10 11 using namespace std; 12 10 13 class MNode 11 14 { 12 15 public: 13 16 14 char type[MAXFORMLEN]; 17 int pos; 18 char form[256]; 15 19 Cat cat; 16 int pos; 17 vector<MNode*> pred; 20 vector<int> pred; 18 21 vector<int> snodes; 19 22 20 23 void clear() { snodes.clear(); }; 21 24 }; 22 25 23 26 class MGraph 24 27 { 25 28 public: 26 29 27 MNode nodes[MAXNODES]; 28 int n; 30 void clear() { nodes.clear(); } 31 int size() { return nodes.size(); } 32 int add_node(char* seg); 33 MNode& operator[](int i) { return nodes[i]; } 29 34 30 void clear() { n=0; }; 31 int add_node(char* seg); 35 private: 36 37 vector<MNode> nodes; 38 32 39 }; 33 40 -
src/dgp/sgraph.cc
r5f4d9c3 re7de6cc 1 1 #include "global.hh" 2 2 #include "sgraph.hh" 3 #include "mgraph.hh"4 3 #include "grammar.hh" 5 4 #include "const.hh" 6 #include <stdio.h> 5 #include <cstdio> 6 #include <sstream> 7 7 8 extern MGraph mgraph; 8 9 9 int SGraph::add_base_snode(MNode* mn) 10 //==================================================================================================== 11 12 int SGraph::add_base_snode(int mnodeind) 10 13 { 11 int nodeind=n; 12 SNode &node=nodes[n]; 14 SNode& newnode = makenewnode(); 13 15 14 n ode.clear();16 newnode.mnode=mnodeind; 15 17 16 node.mnode=mn; 17 18 for(vector<MNode*>::iterator pm=node.mnode->pred.begin(); pm!=node.mnode->pred.end(); ++pm) 19 for(vector<int>::iterator ps=(*pm)->snodes.begin(); ps!=(*pm)->snodes.end(); ++ps) 18 for(vector<int>::iterator pm=mgraph[newnode.mnode].pred.begin(); pm!=mgraph[newnode.mnode].pred.end(); ++pm) 19 for(vector<int>::iterator ps=mgraph[*pm].snodes.begin(); ps!=mgraph[*pm].snodes.end(); ++ps) 20 20 if(nodes[*ps].in_LH) 21 21 { 22 n ode.LV.set(*ps);23 if(nodes[*ps].saturated()) n ode.LV |= nodes[*ps].LH;22 newnode.LV.set(*ps); 23 if(nodes[*ps].saturated()) newnode.LV |= nodes[*ps].LH; 24 24 } 25 25 26 mn->snodes.push_back(nodeind); 27 ++n; 26 mgraph[newnode.mnode].snodes.push_back(lastnodeind()); 28 27 29 n ode.in_LH=true;28 newnode.in_LH=true; 30 29 31 return nodeind;30 return lastnodeind(); 32 31 } 33 32 33 //==================================================================================================== 34 34 35 35 void SGraph::update_left(int headind, int depind) … … 37 37 SNode &head=nodes[headind], &dep=nodes[depind]; 38 38 39 if(dep.saturated()) head.LV |= dep.LV,head.LD |= dep.LD;39 if(dep.saturated()) head.LV |= dep.LV, head.LD |= dep.LD; 40 40 } 41 41 … … 46 46 47 47 dep.LH.set(headind); 48 if(head.saturated()) 49 dep.LH |= head.LH; 50 } 48 if(head.saturated()) dep.LH |= head.LH; 49 } 51 50 51 //==================================================================================================== 52 52 53 53 int SGraph::clone(int ancind, NodeProp newprop) 54 54 { 55 int newind = n++; 56 SNode &newnode=nodes[newind]; 55 SNode &newnode=makenewnode(); 57 56 SNode &ancnode = nodes[ancind]; 58 57 59 newnode.clear(); 58 59 60 60 newnode.prop=newprop; 61 61 newnode.mnode=ancnode.mnode; 62 newnode.mnode->snodes.push_back(newind); 63 return newind; 62 mgraph[newnode.mnode].snodes.push_back(lastnodeind()); 63 64 return lastnodeind(); 64 65 } 65 66 66 67 //------------------------------------------------------------------------- 68 //------------------------------------------------------------------------- 69 67 //==================================================================================================== 70 68 71 69 int SGraph::print_node(FILE* f, int n, unsigned int info) 72 70 { 73 char buf[ 1000];74 sprint_node(buf,n, info);71 char buf[50000]; 72 sprint_node(buf,n,-1,info); 75 73 fputs(buf,f); 76 74 } 77 75 78 int SGraph::sprint_node(char* buf, int nodeind, unsigned int info) 76 //---------------------------------------------------------------------------------------------------- 77 78 int SGraph::print_node_debug(FILE* f, const char* pref, int n, int anc) 79 { 80 char buf[50000]; 81 sprint_node_debug(buf,pref,n,anc); 82 fputs(buf,f); 83 } 84 85 //---------------------------------------------------------------------------------------------------- 86 87 void SGraph::print_arc(FILE* f, int head, int dep, Role role, int dir) // 0 - left, 1 - right 88 { 89 if(dir==0) 90 fprintf(f,"#A %s:%d <-- %d\n", role.str(), dep, head); 91 else 92 fprintf(f,"#A %s:%d --> %d\n", role.str(), head, dep); 93 } 94 95 //==================================================================================================== 96 97 int SGraph::sprint_node(char* buf, int nodeind, int anc, unsigned int info) 79 98 { 80 99 char* buf0=buf; 81 char descr[256];82 char nodeinfo[16];83 100 84 101 SNode &node=nodes[nodeind]; 85 102 86 103 buf+=sprintf(buf," dgp:%d",nodeind); 104 if(anc>=0) buf+=sprintf(buf,"(%d)",anc); 87 105 buf+=sprintf(buf, saturated(nodeind) ? ";s" : ";u"); 88 106 107 if (info&HEADS || info&DEPS) 108 buf+=sprintf(buf,";"); 109 89 110 bool cont=false; 111 90 112 if (info&HEADS) 91 {92 buf+=sprintf(buf,";");93 113 for(vector<Arc>::iterator h=node.heads.begin(); h!=node.heads.end(); ++h) 94 114 { 95 115 if(cont) buf+=sprintf(buf,","); else cont=true; 96 buf+=sprintf(buf,"++%s-%d /%d",h->role.str(),h->dst,h->anc);116 buf+=sprintf(buf,"++%s-%d(%d~%d)",h->role.str(),h->dst,h->headanc,h->depanc); 97 117 } 98 } 99 118 100 119 if (info&DEPS) 101 {102 buf+=sprintf(buf,";");103 120 for(vector<Arc>::iterator d=node.deps.begin(); d!=node.deps.end(); ++d) 104 121 { 105 122 // if(! nodes[d->dst].saturated()) continue; // NIE DRUKUJ NIENASYCONYCH PODRZEDNIKOW 106 123 if(cont) buf+=sprintf(buf,","); else cont=true; 107 buf+=sprintf(buf,"--%s-%d /%d",d->role.str(),d->dst,d->anc);124 buf+=sprintf(buf,"--%s-%d(%d~%d)",d->role.str(),d->dst,d->headanc,d->depanc); 108 125 } 109 }110 126 111 127 if (info&SETS) … … 113 129 int ord=0; 114 130 buf+=sprintf(buf,";{"); 115 for(vector< MNode*>::iterator pm=node.mnode->pred.begin(); pm!=node.mnode->pred.end(); ++pm)116 for(vector<int>::iterator ps= (*pm)->snodes.begin(); ps!=(*pm)->snodes.end(); ++ps)131 for(vector<int>::iterator pm=mgraph[node.mnode].pred.begin(); pm!=mgraph[node.mnode].pred.end(); ++pm) 132 for(vector<int>::iterator ps=mgraph[*pm].snodes.begin(); ps!=mgraph[*pm].snodes.end(); ++ps) 117 133 buf+=sprintf(buf, ord++ ? ",%d" : "%d", *ps); 118 134 buf+=sprintf(buf,"};{"); 119 ord=0;for(int j=0; j< =n; ++j) if(node.LV[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);135 ord=0;for(int j=0; j<size(); ++j) if(node.LV[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j); 120 136 buf+=sprintf(buf,"};{"); 121 ord=0;for(int j=0; j< =n; ++j) if(node.LH[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);137 ord=0;for(int j=0; j<size(); ++j) if(node.LH[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j); 122 138 buf+=sprintf(buf,"};{"); 123 ord=0;for(int j=0; j< =n; ++j) if(node.LD[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j);139 ord=0;for(int j=0; j<size(); ++j) if(node.LD[j]) buf+=sprintf(buf, ord++ ? ",%d" : "%d", j); 124 140 buf+=sprintf(buf,"}"); 125 141 } … … 133 149 for(Role i=1; i<=Role::count(); ++i) 134 150 if(node.prop.required[i]) buf+=sprintf(buf,"%s&%s",(cont++)?",":"",i.str()); 151 for(Role i=1; i<=Role::count(); ++i) 152 if(node.prop.attached[i]) buf+=sprintf(buf,"%s+%s",(cont++)?",":"",i.str()); 153 for(Flag i=1; i<=Flag::count(); ++i) 154 if(node.prop.flags [i]) buf+=sprintf(buf,"%s<%s>",(cont++)?",":"",i.str()); 155 if(node.prop.init_attached) 156 buf+=sprintf(buf,"<init>"); 157 if(node.prop.fin_attached) 158 buf+=sprintf(buf,"<fin>"); 159 160 stringstream oss; 161 for(list<Boubble*>::iterator b = node.prop.boubbles.begin(); b != node.prop.boubbles.end(); b++) 162 oss << (cont++ ? "," : "") << **b; 163 buf+=sprintf(buf,oss.str().c_str()); 135 164 } 136 165 … … 141 170 142 171 143 int SGraph::sprint_node_debug(char* buf, const char* pref, int n )172 int SGraph::sprint_node_debug(char* buf, const char* pref, int n, int anc) 144 173 { 145 174 char *buf0 = buf; 146 175 buf+=sprintf(buf,"#%s",pref); 147 buf+=sprint_node(buf,n,HEADS|DEPS|SETS|CONSTRAINTS); 176 177 buf+=sprintf(buf,"%-16s",form(n)); 178 179 buf+=sprint_node(buf,n,anc,HEADS|DEPS|SETS|CONSTRAINTS); 148 180 buf+=sprintf(buf,"\n"); 149 181 return buf-buf0; 150 182 } 151 183 152 int SGraph::print_node_debug(FILE* f, const char* pref, int n)153 {154 char buf[1000];155 sprint_node_debug(buf,pref,n);156 fputs(buf,f);157 }158 159 void SGraph::print_arc(FILE* f, int left, int right, Role role, int dir) // 0 - left, 1 - right160 {161 fprintf(f,"# %s:%s.%02d %s %s.%02d\n",162 role.str(),nodes[left].mnode->type,left,163 dir ? "-->" : "<--",164 nodes[right].mnode->type,right);165 } -
src/dgp/sgraph.hh
r5f4d9c3 re7de6cc 9 9 10 10 #include "const.hh" 11 #include "mgraph.hh" 11 12 #include "thesymbols.hh" 12 13 14 class MNode; 15 16 13 #include "boubble.hh" 14 15 16 using namespace std; 17 18 //==================================================================================================== 19 // CLASS Arc 20 //==================================================================================================== 17 21 struct Arc 18 22 { 19 23 int dst; 20 24 Role role; 21 int anc; 25 int headanc; 26 int depanc; 22 27 23 Arc(int d, Role r, int a) : dst(d), role(r), anc(a) {}; 24 }; 25 28 Arc(int d, Role r, int ha, int da) : dst(d), role(r), headanc(ha), depanc(da) {}; 29 }; 30 31 //==================================================================================================== 32 // CLASS NodeProp 33 //==================================================================================================== 26 34 27 35 struct NodeProp 28 36 { 29 bitset<MAXTYPES> required; 30 bitset<MAXTYPES> forbidden; 31 32 bool operator==(const NodeProp& p) 33 { return required==p.required && forbidden==p.forbidden; } 34 35 void clear() 36 { required.reset(), forbidden.reset(); } 37 38 }; 39 37 NodeProp(); 38 NodeProp(const NodeProp& p); 39 ~NodeProp(); 40 41 bool operator==(const NodeProp& p); 42 NodeProp& operator=(const NodeProp& p); 43 44 void clear_boubbles(); 45 void merge_boubbles(list<Boubble*> new_boubbles); 46 47 void copy(const NodeProp& p); 48 void clear(); 49 50 RoleSet required; 51 RoleSet forbidden; 52 RoleSet attached; 53 54 bool init_attached; 55 bool fin_attached; 56 57 FlagSet flags; 58 59 list<Boubble*> boubbles; 60 }; 61 62 //---------------------------------------------------------------------------------------------------- 63 64 inline 65 bool NodeProp::operator==(const NodeProp& p) 66 { 67 if(required != p.required) return false; 68 if(forbidden != p.forbidden) return false; 69 if(attached != p.attached) return false; 70 if(flags != p.flags) return false; 71 if(init_attached != p.init_attached) return false; 72 if(fin_attached != p.fin_attached) return false; 73 74 list<Boubble*>::const_iterator b1 = p.boubbles.begin(); 75 for(list<Boubble*>::const_iterator b = boubbles.begin(); b != boubbles.end(); b++) 76 { 77 if(b1 == p.boubbles.end()) 78 return false; 79 if(!(**b == **b1)) 80 return false; 81 } 82 if(b1 != p.boubbles.end()) 83 return false; 84 85 return true; 86 } 87 88 //---------------------------------------------------------------------------------------------------- 89 90 inline 91 void NodeProp::clear_boubbles() 92 { 93 for(list<Boubble*>::iterator b = boubbles.begin(); b!=boubbles.end(); b++) 94 delete *b; 95 boubbles.clear(); 96 } 97 98 //---------------------------------------------------------------------------------------------------- 99 100 inline 101 void NodeProp::merge_boubbles(list<Boubble*> new_boubbles) 102 { 103 boubbles.merge(new_boubbles); 104 } 105 106 //---------------------------------------------------------------------------------------------------- 107 108 inline 109 void NodeProp::copy(const NodeProp& p) 110 { 111 required=p.required; 112 forbidden=p.forbidden; 113 attached=p.attached; 114 flags=p.flags; 115 init_attached=p.init_attached; 116 fin_attached=p.fin_attached; 117 for(list<Boubble*>::const_iterator b = p.boubbles.begin(); b!=p.boubbles.end(); b++) 118 boubbles.push_back(new Boubble(**b)); 119 } 120 121 //---------------------------------------------------------------------------------------------------- 122 123 inline 124 NodeProp::~NodeProp() 125 { 126 clear_boubbles(); 127 } 128 //---------------------------------------------------------------------------------------------------- 129 130 inline 131 NodeProp::NodeProp() 132 { 133 clear(); 134 } 135 136 //---------------------------------------------------------------------------------------------------- 137 138 inline 139 NodeProp::NodeProp(const NodeProp& p) 140 { 141 copy(p); 142 } 143 144 //---------------------------------------------------------------------------------------------------- 145 146 inline 147 NodeProp& NodeProp::operator=(const NodeProp& p) 148 { 149 clear(); 150 copy(p); 151 return *this; 152 } 153 154 //---------------------------------------------------------------------------------------------------- 155 156 inline 157 void NodeProp::clear() 158 { 159 required.reset(); 160 forbidden.reset(); 161 attached.reset(); 162 init_attached=false; 163 fin_attached=false; 164 clear_boubbles(); 165 } 166 167 //==================================================================================================== 168 // CLASS SNode 169 //==================================================================================================== 40 170 41 171 struct SNode 42 172 { 43 173 44 MNode*mnode;174 int mnode; 45 175 46 176 NodeProp prop; … … 54 184 vector<Arc> deps; 55 185 56 void clear() { prop.clear(), LV.reset(), LD.reset(), LH.reset(), heads.clear(), deps.clear(); } 57 bool saturated() { return prop.required.none(); } 58 }; 59 60 186 void clear(); 187 bool saturated(); 188 }; 189 190 //---------------------------------------------------------------------------------------------------- 191 inline 192 void SNode::clear() 193 { prop.clear(), LV.reset(), LD.reset(), LH.reset(), heads.clear(), deps.clear(); } 194 //---------------------------------------------------------------------------------------------------- 195 inline 196 bool SNode::saturated() 197 { return prop.required.none(); } 198 199 //==================================================================================================== 200 // SGraph CLASS 201 //==================================================================================================== 61 202 62 203 class SGraph … … 64 205 public: 65 206 66 SNode nodes[MAXNODES]; 67 int n; // number of nodes 68 69 enum Output { HEADS=1, DEPS=2, SETS=4, CONSTRAINTS=8 }; 70 71 SGraph() : n(0) {} 72 73 void clear() { n=0; } 74 75 int add_base_snode(MNode* mn); 76 int clone(int ancind, NodeProp newprop); 207 enum Output { HEADS=1, DEPS=2, SETS=4, CONSTRAINTS=8, BOUBBLES=16 }; 208 209 SGraph(MGraph& mg) : mgraph(mg) { clear(); } 210 211 SNode& operator[](const int i) { return nodes[i]; } 212 213 void clear() { nodes.clear(); } 214 int add_base_snode(int mnodeind); 215 int clone(int ancind, NodeProp newprop); 77 216 void update_left(int headind, int depind); 78 217 void update_right(int headind, int depind); 79 80 218 bool visible(int left, int right); 81 219 bool saturated(int node); 82 220 83 //-------------------------------------------------------------------- 84 85 void read(FILE* f); 86 void write(FILE* f, list<int> nodelist, unsigned int info); 87 88 int sprint_node(char* buf, int n, unsigned int info); 221 Cat cat(int i) const { return mgraph[nodes[i].mnode].cat; } 222 char* form(int i) const { return mgraph[nodes[i].mnode].form; } 223 89 224 int print_node(FILE* f, int n, unsigned int info); 90 int sprint_node_debug(char* buf, const char* pref, int n); 91 int print_node_debug(FILE* f, const char* pref, int n); 225 int print_node_debug(FILE* f, const char* pref, int n, int anc); 92 226 93 227 void print_arc(FILE* f, int left, int right, Role role, int dir); // 0 - left, 1 - right 94 228 95 }; 96 229 //private: 230 231 int size() {return nodes.size(); } 232 233 private: 234 235 MGraph& mgraph; 236 237 vector<SNode> nodes; 238 239 int lastnodeind() { return nodes.size()-1; } 240 SNode& makenewnode() { nodes.push_back(SNode()); nodes.back().clear(); return nodes.back(); } 241 242 int sprint_node(char* buf, int n, int anc, unsigned int info); 243 int sprint_node_debug(char* buf, const char* pref, int n, int anc); 244 }; 245 246 //---------------------------------------------------------------------------------------------------- 97 247 98 248 inline bool SGraph::visible(int left, int right) … … 101 251 } 102 252 253 //---------------------------------------------------------------------------------------------------- 254 103 255 inline bool SGraph::saturated(int node) 104 256 { … … 106 258 } 107 259 260 //---------------------------------------------------------------------------------------------------- 261 108 262 #endif -
src/dgp/symbol.hh
r5f4d9c3 re7de6cc 3 3 4 4 #include <ext/hash_map> 5 //#include <ext/hash_fun.h>6 5 #include <string> 7 #include < string.h>6 #include <cstring> 8 7 #include <fstream> 9 8 #include <vector> … … 58 57 /// Symbol class template. 59 58 /** The template argument determines the symbol space. 60 Each space is created with symbol "NULL" with index ed0 already in.59 Each space is created with symbol "NULL" with index 0 already in. 61 60 */ 62 61 … … 104 103 105 104 Symbol(const char * s) : val(defs[s]) {}; 106 105 106 Symbol(string s) : val(defs[(char*)s]) {}; 107 108 109 bool empty() const { return val==0; } 110 107 111 /// Symbol to char* conversion. If symbol is invalid, NULL is returned. 108 112 const char* str() const { return (val>=0 && val<count())?defs[val]:NULL; }; … … 113 117 s=0; while(++s) ... 114 118 */ 119 115 120 (operator int)() const { return val; }; 116 121 -
src/dgp/thesymbols.hh
r5f4d9c3 re7de6cc 9 9 #include <bitset> 10 10 11 typedef Symbol<1> Cat;11 using namespace std; 12 12 13 typedef Symbol<2> Role; 14 typedef list<Role> RoleList; 15 typedef list<Role>::iterator RoleListIter; 16 typedef bitset<MAXTYPES> RoleSet; 17 typedef set<Role> Roles; 18 typedef Roles::iterator RolesIter; 13 typedef Symbol<1> Cat; 14 typedef bitset<MAXCATS> CatSet; 19 15 20 typedef Symbol<3> Constr; 21 typedef list<Constr> ConstrList; 16 typedef Symbol<2> Role; 17 typedef list<Role> RoleList; 18 typedef list<Role>::iterator RoleListIter; 19 typedef bitset<MAXTYPES> RoleSet; 20 typedef set<Role> Roles; 21 typedef Roles::iterator RolesIter; 22 23 typedef Symbol<3> Constr; 24 typedef list<Constr> ConstrList; 22 25 typedef list<Constr>::iterator ConstrListIter; 23 26 24 typedef Symbol<4> Rel; 27 typedef Symbol<4> LongRel; 28 typedef set<LongRel> LongRels; 25 29 26 typedef Symbol<5> Flag; 27 typedef bitset<MAXFLAGS> FlagSet; 30 typedef Symbol<5> Flag; 31 typedef bitset<MAXFLAGS> FlagSet; 32 33 typedef Symbol<6> Prop; 34 typedef bitset<MAXPROPS> PropSet; 28 35 29 36 #endif -
src/gph/gph
r5f4d9c3 re7de6cc 14 14 15 15 16 my $systemconfigfile='/ usr/local/etc/utt/gph.conf';16 my $systemconfigfile='/etc/utt/gph.conf'; 17 17 my $userconfigfile=home()."/.utt/gph.conf"; 18 18
Note: See TracChangeset
for help on using the changeset viewer.