Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus-web-services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lange, Dr. Herbert
corpus-web-services
Commits
ba273481
Commit
ba273481
authored
3 years ago
by
Lange, Dr. Herbert
Browse files
Options
Downloads
Patches
Plain Diff
fix issues with changes of corpus services
parent
f82867c3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/uni_hamburg/corpora/server/CorpusChecker.java
+3
-2
3 additions, 2 deletions
...ain/java/de/uni_hamburg/corpora/server/CorpusChecker.java
src/main/java/de/uni_hamburg/corpora/server/CorpusServices.java
+6
-4
6 additions, 4 deletions
...in/java/de/uni_hamburg/corpora/server/CorpusServices.java
with
9 additions
and
6 deletions
src/main/java/de/uni_hamburg/corpora/server/CorpusChecker.java
+
3
−
2
View file @
ba273481
...
@@ -68,7 +68,7 @@ class CorpusThread extends Thread {
...
@@ -68,7 +68,7 @@ class CorpusThread extends Thread {
try
{
try
{
// Create corpus from given input file/folder
// Create corpus from given input file/folder
Corpus
corpus
=
new
Corpus
(
cio
.
read
(
new
File
(
inFile
).
toURI
().
toURL
()))
;
Corpus
corpus
=
new
Corpus
(
cio
.
read
(
new
File
(
inFile
).
toURI
().
toURL
()
,
report
))
;
logger
.
info
(
"Loaded "
+
corpus
.
getCorpusData
().
size
()
+
" corpus files"
);
logger
.
info
(
"Loaded "
+
corpus
.
getCorpusData
().
size
()
+
" corpus files"
);
// For all functions to be applied, get their canonical name and create an object for them
// For all functions to be applied, get their canonical name and create an object for them
Set
<
CorpusFunction
>
functions
=
new
HashSet
<>()
;
Set
<
CorpusFunction
>
functions
=
new
HashSet
<>()
;
...
@@ -123,7 +123,8 @@ class CorpusThread extends Thread {
...
@@ -123,7 +123,8 @@ class CorpusThread extends Thread {
}
}
// Generate HTML report
// Generate HTML report
Collection
<
ReportItem
>
rawStatistics
=
report
.
getRawStatistics
();
Collection
<
ReportItem
>
rawStatistics
=
report
.
getRawStatistics
();
String
reportOutput
=
ReportItem
.
generateDataTableHTML
(
rawStatistics
,
report
.
getSummaryLines
());
String
reportOutput
=
ReportItem
.
generateDataTableHTML
(
new
ArrayList
<>(
rawStatistics
),
report
.
getSummaryLines
());
// Alternative: Generate XML
// Alternative: Generate XML
//XStream xstream = new XStream();
//XStream xstream = new XStream();
//String reportOutput = xstream.toXML(rawStatistics);
//String reportOutput = xstream.toXML(rawStatistics);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/uni_hamburg/corpora/server/CorpusServices.java
+
6
−
4
View file @
ba273481
...
@@ -7,7 +7,6 @@ import de.uni_hamburg.corpora.ReportItem;
...
@@ -7,7 +7,6 @@ import de.uni_hamburg.corpora.ReportItem;
import
org.reflections.Reflections
;
import
org.reflections.Reflections
;
import
java.lang.reflect.Modifier
;
import
java.lang.reflect.Modifier
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -15,8 +14,8 @@ import java.util.stream.Collectors;
...
@@ -15,8 +14,8 @@ import java.util.stream.Collectors;
/**
/**
* @author bba1792 Dr. Herbert Lange
* @author bba1792 Dr. Herbert Lange
* @version 202
10708
* @version 202
20404
* Class encapsulating some
of the
corpus services functionality
* Class encapsulating some corpus services functionality
*/
*/
public
class
CorpusServices
{
public
class
CorpusServices
{
/**
/**
...
@@ -29,7 +28,10 @@ public class CorpusServices {
...
@@ -29,7 +28,10 @@ public class CorpusServices {
Reflections
reflections
=
new
Reflections
(
"de.uni_hamburg.corpora"
);
Reflections
reflections
=
new
Reflections
(
"de.uni_hamburg.corpora"
);
Set
<
Class
<?
extends
CorpusFunction
>>
classes
=
reflections
.
getSubTypesOf
(
CorpusFunction
.
class
);
Set
<
Class
<?
extends
CorpusFunction
>>
classes
=
reflections
.
getSubTypesOf
(
CorpusFunction
.
class
);
// Convert classes to class names
// Convert classes to class names
return
classes
.
stream
().
filter
((
c
)
->
!
Modifier
.
isAbstract
(
c
.
getModifiers
())).
map
(
Class:
:
getCanonicalName
).
collect
(
Collectors
.
toSet
());
return
classes
.
stream
()
.
filter
((
c
)
->
Modifier
.
isPublic
(
c
.
getModifiers
())
&&
!
Modifier
.
isAbstract
(
c
.
getModifiers
()))
.
map
(
Class:
:
getCanonicalName
)
.
collect
(
Collectors
.
toSet
());
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment