Skip to content

Commit

Permalink
#25 far moved to a new repo
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Dec 15, 2021
1 parent 9b3797e commit ffa8868
Show file tree
Hide file tree
Showing 31 changed files with 47 additions and 1,879 deletions.
14 changes: 5 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,10 @@ SOFTWARE.
<artifactId>cactoos</artifactId>
<version>0.46</version>
</dependency>
<dependency>
<groupId>com.jcabi.incubator</groupId>
<artifactId>xembly</artifactId>
<version>0.25.0</version>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-log</artifactId>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-matchers</artifactId>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-xml</artifactId>
Expand All @@ -84,6 +75,11 @@ SOFTWARE.
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.polystat</groupId>
<artifactId>far</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.polystat.odin</groupId>
<artifactId>interop_2.13</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,24 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.polystat;

import com.jcabi.xml.XML;
import org.cactoos.Func;
import org.polystat.far.FaR;

/**
* Package related to odin.
* Bridge to FaR analysis module.
*
* @since 0.3
* @see <a href="https://github.com/polystat/odin">GitHub Org</a>
* @see <a href="https://github.com/polystat/far">GitHub</a>
* @since 0.4
*/
package org.polystat.odin;
public final class AnFaR implements Analysis {

@Override
public Iterable<String> errors(final Func<String, XML> xmir,
final String locator) throws Exception {
return new FaR().errors(xmir, locator);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package org.polystat.odin;
package org.polystat;

import com.jcabi.xml.XML;
import java.util.List;
import java.util.stream.Collectors;
import org.cactoos.Func;
import org.cactoos.list.ListOf;
import org.polystat.Analysis;
import org.polystat.odin.analysis.mutualrec.naive.exceptions.UnsupportedDecoration;
import org.polystat.odin.interop.java.EOOdinAnalyzer;
import org.polystat.odin.interop.java.OdinAnalysisErrorInterop;
Expand All @@ -39,19 +38,7 @@
* @see <a href="https://github.com/polystat/odin">Github</a>
* @since 0.3
*/
public final class OdinAnalysis implements Analysis {

/**
* Odin analyzer that performs analysis.
*/
private final EOOdinAnalyzer<String> analyzer;

/**
* Ctor.
*/
public OdinAnalysis() {
this.analyzer = new EOOdinAnalyzer.EOOdinXmirAnalyzer();
}
public final class AnOdin implements Analysis {

@Override
public Iterable<String> errors(final Func<String, XML> xmir,
Expand All @@ -60,7 +47,8 @@ public Iterable<String> errors(final Func<String, XML> xmir,
final String str = getObjectsHierarchy(xmir, xml);
Iterable<String> result;
try {
result = this.analyzer.analyze(str).stream()
result = new EOOdinAnalyzer.EOOdinXmirAnalyzer()
.analyze(str).stream()
.map(OdinAnalysisErrorInterop::message)
.collect(Collectors.toList());
} catch (final UnsupportedDecoration ex) {
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/org/polystat/Polystat.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import java.util.List;
import org.cactoos.Func;
import org.cactoos.list.ListOf;
import org.polystat.far.Reverses;
import org.polystat.odin.OdinAnalysis;

/**
* Main entrance.
Expand All @@ -47,8 +45,8 @@ public final class Polystat {
* Analyzers.
*/
private static final Analysis[] ALL = {
new Reverses(),
new OdinAnalysis(),
new AnFaR(),
new AnOdin(),
};

/**
Expand Down Expand Up @@ -93,15 +91,21 @@ public void exec(final String... args) throws Exception {
);
for (final Analysis analysis : Polystat.ALL) {
final List<String> errors = new ListOf<>(
analysis.errors(xmir, "\\Phi.foo")
analysis.errors(xmir, "\\Phi.test")
);
Logger.info(
this, "%d errors found by %s",
errors.size(), analysis.getClass()
);
for (final String error : errors) {
Logger.info(this, "Error: %s", error);
this.stdout.printf("Error: %s%n", error);
Logger.info(
this, "%s: %s",
analysis.getClass().getSimpleName(), error
);
this.stdout.printf(
"%s: %s%n",
analysis.getClass().getSimpleName(), error
);
}
if (errors.isEmpty()) {
Logger.info(this, "No errors found");
Expand Down
136 changes: 0 additions & 136 deletions src/main/java/org/polystat/far/Calc.java

This file was deleted.

Loading

2 comments on commit ffa8868

@0pdd
Copy link
Member

@0pdd 0pdd commented on ffa8868 Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1-9db318e4 disappeared from src/main/java/org/polystat/far/Reverses.java, that's why I closed #3. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link
Member

@0pdd 0pdd commented on ffa8868 Dec 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1-0cf4e1de disappeared from src/test/java/org/polystat/far/ExprTest.java, that's why I closed #7. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

Please sign in to comment.