File tree Expand file tree Collapse file tree 5 files changed +56
-2
lines changed
Expand file tree Collapse file tree 5 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 1+ Configuration.php
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SyntaxTreeApi\Config;
4+
5+ class Configuration extends DefaultConfiguration
6+ {
7+
8+ /**
9+ * Path to TensorFlow`s syntaxnet
10+ * @var string
11+ */
12+ protected static $syntaxNetPath = ' /home/tensor/tensorflow/models/syntaxnet/' ;
13+
14+ /**
15+ * Path to model for syntaxnet
16+ * @var string
17+ */
18+ protected static $syntaxNetModelPath = ' /home/tensor/tensorflow/Russian-SynTagRus' ;
19+
20+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SyntaxTreeApi \Config ;
4+
5+ interface ConfigurationInterface
6+ {
7+
8+ public static function getSyntaxNetPath ();
9+
10+ public static function getSyntaxNetModelPath ();
11+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace SyntaxTreeApi \Config ;
4+
5+ class DefaultConfiguration implements ConfigurationInterface
6+ {
7+
8+ protected static $ syntaxNetPath ;
9+ protected static $ syntaxNetModelPath ;
10+
11+ public static function getSyntaxNetPath ()
12+ {
13+ return static ::$ syntaxNetPath ;
14+ }
15+
16+ public static function getSyntaxNetModelPath ()
17+ {
18+ return static ::$ syntaxNetModelPath ;
19+ }
20+
21+ }
Original file line number Diff line number Diff line change 33namespace SyntaxTreeApi \Model ;
44
55use SyntaxTree \Command \TensorFlowCommand ;
6+ use SyntaxTreeApi \Config \Configuration ;
67
78class ParseSyntaxCommandFactory
89{
@@ -11,7 +12,7 @@ public static function createTensorFlowCommand()
1112 $ command = new TensorFlowCommand ();
1213
1314 return $ command
14- ->setSyntaxnetPath (' /home/tensor/tensorflow/models/syntaxnet/ ' )
15- ->setModelPath (' /home/tensor/tensorflow/Russian-SynTagRus ' );
15+ ->setSyntaxnetPath (Configuration:: getSyntaxNetPath () )
16+ ->setModelPath (Configuration:: getSyntaxNetModelPath () );
1617 }
1718}
You can’t perform that action at this time.
0 commit comments