| 134 | }; |
| 135 | |
| 136 | void addLabelTypes(py::Module& module) |
| 137 | { |
| 138 | module.addType( |
| 139 | py::define<CandidateObject>("tomotopy.label.Candidate", "_LabelCandidate", Py_TPFLAGS_BASETYPE) |
| 140 | .property<&CandidateObject::getWords>("words") |
| 141 | .property<&CandidateObject::getName, &CandidateObject::setName>("name") |
| 142 | .property<&CandidateObject::getScore>("score") |
| 143 | .property<&CandidateObject::getCf>("cf") |
| 144 | .property<&CandidateObject::getDf>("df") |
| 145 | ); |
| 146 | |
| 147 | module.addType( |
| 148 | py::define<PMIExtractorObject>("tomotopy.label.PMIExtractor", "_LabelPMIExtractor", Py_TPFLAGS_BASETYPE) |
| 149 | .method<&PMIExtractorObject::extract>("extract") |
| 150 | ); |
| 151 | |
| 152 | module.addType( |
| 153 | py::define<FoRelevanceObject>("tomotopy.label.FoRelevance", "_LabelFoRelevance", Py_TPFLAGS_BASETYPE) |
| 154 | .method<&FoRelevanceObject::getTopicLabels>("get_topic_labels") |
| 155 | ); |
| 156 | } |