forked from google/language-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sparrowhawk.BUILD
150 lines (138 loc) · 3.61 KB
/
sparrowhawk.BUILD
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
package(default_visibility = ["//visibility:public"])
load("@protobuf//:protobuf.bzl", "cc_proto_library")
cc_proto_library(
name = "sparrowhawk_configuration_cc_proto",
srcs = ["src/proto/sparrowhawk_configuration.proto"],
include = "src/proto",
default_runtime = "@protobuf//:protobuf",
protoc = "@protobuf//:protoc",
)
cc_proto_library(
name = "rule_order_cc_proto",
srcs = ["src/proto/rule_order.proto"],
include = "src/proto",
default_runtime = "@protobuf//:protobuf",
protoc = "@protobuf//:protoc",
)
cc_proto_library(
name = "links_cc_proto",
srcs = ["src/proto/links.proto"],
include = "src/proto",
default_runtime = "@protobuf//:protobuf",
protoc = "@protobuf//:protoc",
)
cc_proto_library(
name = "semiotic_classes_cc_proto",
srcs = ["src/proto/semiotic_classes.proto"],
include = "src/proto",
default_runtime = "@protobuf//:protobuf",
protoc = "@protobuf//:protoc",
)
cc_proto_library(
name = "items_cc_proto",
srcs = ["src/proto/items.proto"],
include = "src/proto",
default_runtime = "@protobuf//:protobuf",
protoc = "@protobuf//:protoc",
deps = [
":links_cc_proto",
":semiotic_classes_cc_proto",
],
)
genrule(
name = "make_compatibility_headers",
outs = [
"sparrowhawk/items.pb.h",
"sparrowhawk/rule_order.pb.h",
"sparrowhawk/sparrowhawk_configuration.pb.h",
],
cmd = """
for f in $(OUTS); do
echo "#include <src/proto/$$(basename $$f)>" > $$f
done
""",
)
cc_library(
name = "protos",
hdrs = [
"sparrowhawk/items.pb.h",
"sparrowhawk/rule_order.pb.h",
"sparrowhawk/sparrowhawk_configuration.pb.h",
],
includes = ["."],
deps = [
":items_cc_proto",
":rule_order_cc_proto",
":sparrowhawk_configuration_cc_proto",
],
)
cc_library(
name = "utils",
srcs = [
"src/lib/io_utils.cc",
"src/lib/string_utils.cc",
],
hdrs = [
"src/include/sparrowhawk/io_utils.h",
"src/include/sparrowhawk/logger.h",
"src/include/sparrowhawk/string_utils.h",
],
copts = ["-Wno-sign-compare"],
includes = ["src/include"],
visibility = ["//visibility:private"],
)
cc_library(
name = "regexp",
srcs = ["src/lib/regexp.cc"],
hdrs = ["src/include/sparrowhawk/regexp.h"],
includes = ["src/include"],
visibility = ["//visibility:private"],
deps = [
":utils",
"//external:re2",
"@openfst//:base",
],
)
cc_library(
name = "sentence_boundary",
srcs = ["src/lib/sentence_boundary.cc"],
hdrs = ["src/include/sparrowhawk/sentence_boundary.h"],
copts = ["-Wno-sign-compare"],
includes = ["src/include"],
deps = [
":regexp",
":utils",
"@openfst//:base",
],
)
cc_library(
name = "normalizer",
srcs = [
"src/lib/normalizer.cc",
"src/lib/normalizer_utils.cc",
"src/lib/numbers.cc",
"src/lib/protobuf_parser.cc",
"src/lib/protobuf_serializer.cc",
"src/lib/rule_system.cc",
],
hdrs = [
"src/include/sparrowhawk/normalizer.h",
"src/include/sparrowhawk/numbers.h",
"src/include/sparrowhawk/protobuf_parser.h",
"src/include/sparrowhawk/protobuf_serializer.h",
"src/include/sparrowhawk/rule_system.h",
],
copts = ["-Wno-sign-compare"],
includes = [
".",
"src/include",
],
deps = [
":protos",
":sentence_boundary",
":utils",
"//external:re2",
"@openfst//:base",
"@thrax//:grm-manager",
],
)