提交 d6526c0d 编写于 作者: L luxin

add keywords_must and keywords_forbid

上级 98856bfb
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
"访问网页数据的传递过程" "访问网页数据的传递过程"
], ],
"children": [], "children": [],
"node_id": "network-90eb249a1a944545bec9375caa09b7ee" "node_id": "network-90eb249a1a944545bec9375caa09b7ee",
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -15,7 +17,9 @@ ...@@ -15,7 +17,9 @@
"我国网络的发展的发展" "我国网络的发展的发展"
], ],
"children": [], "children": [],
"node_id": "network-f5d2f2b5a7624f7a95ff3e1ab2fa4fc5" "node_id": "network-f5d2f2b5a7624f7a95ff3e1ab2fa4fc5",
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -27,9 +31,13 @@ ...@@ -27,9 +31,13 @@
"资源共享" "资源共享"
], ],
"children": [], "children": [],
"node_id": "network-8a6a24c32e154eb396619dbbfbdab0e7" "node_id": "network-8a6a24c32e154eb396619dbbfbdab0e7",
"keywords_must": [],
"keywords_forbid": []
} }
} }
], ],
"node_id": "network-e0ad5915797348a88f55399a18ca858d" "node_id": "network-e0ad5915797348a88f55399a18ca858d",
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"keywords":["网络设备"], "keywords": [
"网络设备"
],
"children": [ "children": [
{ {
"常见的网络设备": { "常见的网络设备": {
...@@ -18,7 +20,9 @@ ...@@ -18,7 +20,9 @@
"智能家居" "智能家居"
], ],
"children": [], "children": [],
"node_id": "network-2aacb5a4f5a64677ace490d4373d7628" "node_id": "network-2aacb5a4f5a64677ace490d4373d7628",
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
...@@ -30,11 +34,15 @@ ...@@ -30,11 +34,15 @@
"无线路由器" "无线路由器"
], ],
"children": [], "children": [],
"node_id": "network-42e9982de4334db79ea829662e90ea2f" "node_id": "network-42e9982de4334db79ea829662e90ea2f",
"keywords_must": [],
"keywords_forbid": []
} }
} }
], ],
"node_id": "network-c83783f42f4d4fdcb71dd55d3087b7f0" "node_id": "network-c83783f42f4d4fdcb71dd55d3087b7f0",
"keywords_must": [],
"keywords_forbid": []
}, },
"常见的网络介质": { "常见的网络介质": {
"keywords": [ "keywords": [
...@@ -46,30 +54,42 @@ ...@@ -46,30 +54,42 @@
"children": [ "children": [
{ {
"双绞线": { "双绞线": {
"children": [] "children": [],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
"光纤": { "光纤": {
"children": [] "children": [],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
"同轴电缆": { "同轴电缆": {
"children": [] "children": [],
"keywords_must": [],
"keywords_forbid": []
} }
}, },
{ {
"无线电波": { "无线电波": {
"children": [] "children": [],
"keywords_must": [],
"keywords_forbid": []
} }
} }
] ],
"keywords_must": [],
"keywords_forbid": []
} }
} }
], ],
"export": [ "export": [
"01.json" "01.json"
], ],
"node_id": "network-16b1ac6767d947f4b9cf1be248239823" "node_id": "network-16b1ac6767d947f4b9cf1be248239823",
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-05cf5084bf4b4f8dbb7040d4d53efbfa", "node_id": "network-05cf5084bf4b4f8dbb7040d4d53efbfa",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-21e72df6dd5b40dcb57d2daabf9d87b2", "node_id": "network-21e72df6dd5b40dcb57d2daabf9d87b2",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-8afe66fc4e1e4f539061de800a0a23bf", "node_id": "network-8afe66fc4e1e4f539061de800a0a23bf",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-bac5e201cd3f471aa09aef6f6bd9dd6a", "node_id": "network-bac5e201cd3f471aa09aef6f6bd9dd6a",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-e7861382d8474d99b6c81866b3480346", "node_id": "network-e7861382d8474d99b6c81866b3480346",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-9ca6243f54a446089eaf3a8f18dbdf5f", "node_id": "network-9ca6243f54a446089eaf3a8f18dbdf5f",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-903c0a65059e41a88036c457f48d9351", "node_id": "network-903c0a65059e41a88036c457f48d9351",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-93a232d0cf754e6b87dcdd6f43f8cbc8", "node_id": "network-93a232d0cf754e6b87dcdd6f43f8cbc8",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-f5b3ff50904c4fed949e58640a143cfe", "node_id": "network-f5b3ff50904c4fed949e58640a143cfe",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-1ed5189882a04d6da48dc84617427b65", "node_id": "network-1ed5189882a04d6da48dc84617427b65",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-59a5b62a972247948a07ffcf892b56c9", "node_id": "network-59a5b62a972247948a07ffcf892b56c9",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-ec7441d074c1439285eab85cd1d35425", "node_id": "network-ec7441d074c1439285eab85cd1d35425",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-45e9640d996c42d685c497fa6604a764", "node_id": "network-45e9640d996c42d685c497fa6604a764",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-770fb1807a7e4ef59c9f78e06685dd67", "node_id": "network-770fb1807a7e4ef59c9f78e06685dd67",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-e7f2ac802a3e4ac785b5f94d4935dcae", "node_id": "network-e7f2ac802a3e4ac785b5f94d4935dcae",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-44c32ade1eb24e328d84b0970a82c874", "node_id": "network-44c32ade1eb24e328d84b0970a82c874",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-da956c02f676454e8bcaa50e3cfa8e06", "node_id": "network-da956c02f676454e8bcaa50e3cfa8e06",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-5dd420ebd67146afa5219a44cd614a47", "node_id": "network-5dd420ebd67146afa5219a44cd614a47",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-dd30314697c84cc1b696d77dd11aced9", "node_id": "network-dd30314697c84cc1b696d77dd11aced9",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-60f0ba128ba74fa89c79e36884305783", "node_id": "network-60f0ba128ba74fa89c79e36884305783",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-8d8288ccd2b64a109c4f557efe592ac3", "node_id": "network-8d8288ccd2b64a109c4f557efe592ac3",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-ab6bfd85ec3440dd89fea166da0be00c", "node_id": "network-ab6bfd85ec3440dd89fea166da0be00c",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-772cd2af7db94508840e1441a7574877", "node_id": "network-772cd2af7db94508840e1441a7574877",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-cbc2f413286e40fcad470f79d0da9f1d", "node_id": "network-cbc2f413286e40fcad470f79d0da9f1d",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-9d424643d20e4d6a8e563debaad8f21a", "node_id": "network-9d424643d20e4d6a8e563debaad8f21a",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-edb91111e5ff435cbcf23f5537866369", "node_id": "network-edb91111e5ff435cbcf23f5537866369",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-8dd155538a954267abe06242248a083e", "node_id": "network-8dd155538a954267abe06242248a083e",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-1f93a31002cf4fe2924a8c513c4a4a5c", "node_id": "network-1f93a31002cf4fe2924a8c513c4a4a5c",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-d32c188136234d198a3d27aaf251434f", "node_id": "network-d32c188136234d198a3d27aaf251434f",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-74e3d2800f35424a8e98ce089f7c27c6", "node_id": "network-74e3d2800f35424a8e98ce089f7c27c6",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-b9246efd155b47799dc02eb00175bd3d", "node_id": "network-b9246efd155b47799dc02eb00175bd3d",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-85712193cdfa4d82bafaa0f4cd30e266", "node_id": "network-85712193cdfa4d82bafaa0f4cd30e266",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-4a3481cb7b03425582b40d1e0d2e0d51", "node_id": "network-4a3481cb7b03425582b40d1e0d2e0d51",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-5e7027e23eec4c67a7de74e9ab2caba8", "node_id": "network-5e7027e23eec4c67a7de74e9ab2caba8",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-ae82cb15ba26426a91e8a1cb474328ae", "node_id": "network-ae82cb15ba26426a91e8a1cb474328ae",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-bd22073e575c4d4ea1325760a3912954", "node_id": "network-bd22073e575c4d4ea1325760a3912954",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-14c66687e6e84ea68668d40b4cacd873", "node_id": "network-14c66687e6e84ea68668d40b4cacd873",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-656828c7f31c4f72ad230b9e3191161d", "node_id": "network-656828c7f31c4f72ad230b9e3191161d",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-66b95999ea2147c4945a1456eb3baaee", "node_id": "network-66b95999ea2147c4945a1456eb3baaee",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-c554312da0e0433c974d1e489be231e2", "node_id": "network-c554312da0e0433c974d1e489be231e2",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-94a13c6c52614895b92d569cb38b3c87", "node_id": "network-94a13c6c52614895b92d569cb38b3c87",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-d41a109241504ac689c4180793d237fe", "node_id": "network-d41a109241504ac689c4180793d237fe",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-ae056a3111bf495687aad5e94fc72b6b", "node_id": "network-ae056a3111bf495687aad5e94fc72b6b",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-9f63af019f97456bbf2da57a02268d26", "node_id": "network-9f63af019f97456bbf2da57a02268d26",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-47c1720cca854491a63065893b444aa0", "node_id": "network-47c1720cca854491a63065893b444aa0",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-1c08cbe277804c9aa7d86a7cea45bb2b", "node_id": "network-1c08cbe277804c9aa7d86a7cea45bb2b",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-86a74a86c4634c7f991963d8c39c8200", "node_id": "network-86a74a86c4634c7f991963d8c39c8200",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-460e4f45b1dc4746a5e6d53df073d8f3", "node_id": "network-460e4f45b1dc4746a5e6d53df073d8f3",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-872fb874602d49aeaf479aa555f768f7", "node_id": "network-872fb874602d49aeaf479aa555f768f7",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-d6e6178da70c4c488b4e6137a6f4f039", "node_id": "network-d6e6178da70c4c488b4e6137a6f4f039",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-bfec537cc4e74fc0bde6968570bb0bda", "node_id": "network-bfec537cc4e74fc0bde6968570bb0bda",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-2bdf012b3e71446da96b483fb9b9cdc4", "node_id": "network-2bdf012b3e71446da96b483fb9b9cdc4",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-c2ad656b2d434cf2bddae5b67a54a30e", "node_id": "network-c2ad656b2d434cf2bddae5b67a54a30e",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-a4dd1c4a69364d6dba624adaeafbafcb", "node_id": "network-a4dd1c4a69364d6dba624adaeafbafcb",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-aa317ed09bf14c20bb86a1a08d5ec006", "node_id": "network-aa317ed09bf14c20bb86a1a08d5ec006",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-08302221308e40b38de8cf131dad13ad", "node_id": "network-08302221308e40b38de8cf131dad13ad",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-5d740cb0d9a8459f88543a83b6c7c5e8", "node_id": "network-5d740cb0d9a8459f88543a83b6c7c5e8",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-ca8d4d21ad474dfd83573e883cd821d5", "node_id": "network-ca8d4d21ad474dfd83573e883cd821d5",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-f8fb04c24a4e4d4dad049a963e1acdba", "node_id": "network-f8fb04c24a4e4d4dad049a963e1acdba",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-8ef0493e96804c9aa6696c9c8c1ae3ca", "node_id": "network-8ef0493e96804c9aa6696c9c8c1ae3ca",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-40f0e24cb89b479c82163e686b1271c4", "node_id": "network-40f0e24cb89b479c82163e686b1271c4",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
...@@ -2,5 +2,7 @@ ...@@ -2,5 +2,7 @@
"node_id": "network-c0196e2fe2e846bc8a4c9bb338221528", "node_id": "network-c0196e2fe2e846bc8a4c9bb338221528",
"keywords": [], "keywords": [],
"children": [], "children": [],
"export": [] "export": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-c52d5bcef40f45c5bc8a3941c73d2750", "node_id": "network-c52d5bcef40f45c5bc8a3941c73d2750",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"node_id": "network-fd72367657724abd93fd0e6c1b1584fc", "node_id": "network-fd72367657724abd93fd0e6c1b1584fc",
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
{ {
"tree_name": "network", "tree_name": "network",
"keywords": [], "keywords": [],
"node_id": "network-7d5f6fdfd0b04e68aeebfb18474e4c4f" "node_id": "network-7d5f6fdfd0b04e68aeebfb18474e4c4f",
"keywords_must": [],
"keywords_forbid": []
} }
\ No newline at end of file
此差异已折叠。
...@@ -2,10 +2,10 @@ import json ...@@ -2,10 +2,10 @@ import json
import logging import logging
import os import os
import re import re
import subprocess
import sys import sys
import uuid import uuid
import re import re
import git
id_set = set() id_set = set()
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
...@@ -14,15 +14,31 @@ handler = logging.StreamHandler(sys.stdout) ...@@ -14,15 +14,31 @@ handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter) handler.setFormatter(formatter)
logger.addHandler(handler) logger.addHandler(handler)
repo = git.Repo(".")
def user_name(): def search_author(author_dict, username):
return repo.config_reader().get_value("user", "name") for key in author_dict:
names = author_dict[key]
if username in names:
return key
return username
def user_name(md_file, author_dict):
ret = subprocess.Popen([
"git", "log", md_file
], stdout=subprocess.PIPE)
lines = list(map(lambda l: l.decode(), ret.stdout.readlines()))
author_lines = []
for line in lines:
if line.startswith('Author'):
author_lines.append(line.split(' ')[1])
author_nick_name = author_lines[-1]
return search_author(author_dict, author_nick_name)
def load_json(p): def load_json(p):
with open(p, 'r') as f: with open(p, 'r', encoding="utf-8") as f:
return json.loads(f.read()) return json.loads(f.read())
...@@ -77,7 +93,18 @@ def check_export(base, cfg): ...@@ -77,7 +93,18 @@ def check_export(base, cfg):
class TreeWalker: class TreeWalker:
def __init__(self, root, tree_name, title=None, log=None): def __init__(
self, root,
tree_name,
title=None,
log=None,
authors=None,
enable_notebook=None,
ignore_keywords=False
):
self.ignore_keywords = ignore_keywords
self.authors = authors if authors else {}
self.enable_notebook = enable_notebook
self.name = tree_name self.name = tree_name
self.root = root self.root = root
self.title = tree_name if title is None else title self.title = tree_name if title is None else title
...@@ -89,7 +116,9 @@ class TreeWalker: ...@@ -89,7 +116,9 @@ class TreeWalker:
root_node = { root_node = {
"node_id": root["node_id"], "node_id": root["node_id"],
"keywords": root["keywords"], "keywords": root["keywords"],
"children": [] "children": [],
"keywords_must": root["keywords_must"],
"keywords_forbid": root["keywords_forbid"]
} }
self.tree[root["tree_name"]] = root_node self.tree[root["tree_name"]] = root_node
self.load_levels(root_node) self.load_levels(root_node)
...@@ -144,6 +173,8 @@ class TreeWalker: ...@@ -144,6 +173,8 @@ class TreeWalker:
"node_id": config["node_id"], "node_id": config["node_id"],
"keywords": config["keywords"], "keywords": config["keywords"],
"children": [], "children": [],
"keywords_must": config["keywords_must"],
"keywords_forbid": config["keywords_forbid"]
} }
} }
...@@ -195,6 +226,8 @@ class TreeWalker: ...@@ -195,6 +226,8 @@ class TreeWalker:
"tree_name": self.name, "tree_name": self.name,
"keywords": [], "keywords": [],
"node_id": self.gen_node_id(), "node_id": self.gen_node_id(),
"keywords_must": [],
"keywords_forbid": []
} }
dump_json(config_path, config, exist_ok=True, override=True) dump_json(config_path, config, exist_ok=True, override=True)
else: else:
...@@ -224,7 +257,9 @@ class TreeWalker: ...@@ -224,7 +257,9 @@ class TreeWalker:
if not os.path.exists(config_path): if not os.path.exists(config_path):
config = { config = {
"node_id": self.gen_node_id(), "node_id": self.gen_node_id(),
"keywords": [] "keywords": [],
"keywords_must": [],
"keywords_forbid": []
} }
dump_json(config_path, config, exist_ok=True, override=True) dump_json(config_path, config, exist_ok=True, override=True)
else: else:
...@@ -290,6 +325,8 @@ class TreeWalker: ...@@ -290,6 +325,8 @@ class TreeWalker:
"node_id": config["node_id"], "node_id": config["node_id"],
"keywords": config["keywords"], "keywords": config["keywords"],
"children": [], "children": [],
"keywords_must": config["keywords_must"],
"keywords_forbid": config["keywords_forbid"]
} }
} }
return num, result return num, result
...@@ -301,7 +338,9 @@ class TreeWalker: ...@@ -301,7 +338,9 @@ class TreeWalker:
name: { name: {
"node_id": config["node_id"], "node_id": config["node_id"],
"keywords": config.get("keywords", []), "keywords": config.get("keywords", []),
"children": config.get("children", []) "children": config.get("children", []),
"keywords_must": config["keywords_must"],
"keywords_forbid": config["keywords_forbid"]
} }
} }
# if "children" in config: # if "children" in config:
...@@ -318,7 +357,8 @@ class TreeWalker: ...@@ -318,7 +357,8 @@ class TreeWalker:
continue continue
mfile = base + ".json" mfile = base + ".json"
meta_path = os.path.join(section_path, mfile) meta_path = os.path.join(section_path, mfile)
self.ensure_exercises_meta(meta_path, source) md_file = os.path.join(section_path, e)
self.ensure_exercises_meta(meta_path, source, md_file)
export = config.get("export", []) export = config.get("export", [])
if mfile not in export and self.name != "algorithm": if mfile not in export and self.name != "algorithm":
export.append(mfile) export.append(mfile)
...@@ -339,7 +379,7 @@ class TreeWalker: ...@@ -339,7 +379,7 @@ class TreeWalker:
else: else:
id_set.add(exercise["exercise_id"]) id_set.add(exercise["exercise_id"])
def ensure_exercises_meta(self, meta_path, source): def ensure_exercises_meta(self, meta_path, source, md_file):
_, mfile = os.path.split(meta_path) _, mfile = os.path.split(meta_path)
meta = None meta = None
if os.path.exists(meta_path): if os.path.exists(meta_path):
...@@ -354,27 +394,32 @@ class TreeWalker: ...@@ -354,27 +394,32 @@ class TreeWalker:
if "source" not in meta: if "source" not in meta:
meta["source"] = source meta["source"] = source
if "author" not in meta: if "author" not in meta:
meta["author"] = user_name() meta["author"] = user_name(md_file, self.authors)
if "type" not in meta: if "type" not in meta:
meta["type"] = "code_options" meta["type"] = "code_options"
if meta is None:
meta = { if meta is None:
"type": "code_options", meta = {
"author": user_name(), "type": "code_options",
"source": source, "author": user_name(md_file, self.authors),
"notebook_enable": self.default_notebook(), "source": source,
"exercise_id": uuid.uuid4().hex "notebook_enable": self.default_notebook(),
} "exercise_id": uuid.uuid4().hex
}
dump_json(meta_path, meta, True, True) dump_json(meta_path, meta, True, True)
def default_notebook(self): def default_notebook(self):
if self.enable_notebook is not None:
return self.enable_notebook
if self.name in ["python", "java", "c"]: if self.name in ["python", "java", "c"]:
return True return True
else: else:
return False return False
def check_section_keywords(self, full_path): def check_section_keywords(self, full_path):
if self.ignore_keywords:
return
config = self.ensure_section_config(full_path) config = self.ensure_section_config(full_path)
# if not config.get("keywords", []): if not config.get("keywords", []):
# self.logger.error(f"节点 [{full_path}] 的关键字为空,请修改配置文件写入关键字") self.logger.error(f"节点 [{full_path}] 的关键字为空,请修改配置文件写入关键字")
# sys.exit(1) sys.exit(1)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册