-
Notifications
You must be signed in to change notification settings - Fork 16
/
doc.h
56 lines (45 loc) · 1.02 KB
/
doc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// doc.h
//
// URL: https://github.com/d99kris/spacy-cpp
//
// Copyright (C) 2017 Kristofer Berggren
// All rights reserved.
//
// spacy-cpp is distributed under the MIT license, see LICENSE for details.
#pragma once
#include <map>
#include <vector>
#include "pyobjectptr.h"
namespace Spacy
{
class Nlp;
class Span;
class Token;
class Doc
{
friend Nlp;
public:
virtual ~Doc();
std::map<long, long> count_by(long p_attr) const;
std::vector<Span> ents() const;
bool has_vector() const;
bool is_parsed() const;
bool is_tagged() const;
std::vector<Span> noun_chunks() const;
double sentiment() const;
std::vector<Span> sents() const;
double similarity(const Doc& p_doc) const;
std::string text() const;
std::string text_with_ws() const;
std::vector<Token> tokens() const;
double vector_norm() const;
private:
Doc(PyObjectPtr p_doc);
PyObjectPtr get_ptr() const;
private:
PyObjectPtr m_doc;
};
}
#ifdef SPACY_HEADER_ONLY
#include "doc.cpp"
#endif