frequencies);
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/interfaces/IHasID.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.interfaces;
19 |
20 | /**
21 | * An interface for UBY-LMF classes that have a unique identifier.
22 | *
23 | * @author Zijad Maksuti
24 | *
25 | */
26 | public interface IHasID {
27 |
28 |
29 | /**
30 | * Returns the unique identifier of the UBY-LMF object.
31 | * @return the unique identifier of the UBY-LMF object or null,
32 | * if the object does not have the identifier set
33 | *
34 | * Note that all UBY-LMF classes implementing {@link IHasID} interface should
35 | * have this field set. Absence of the value of identifier field may indicate to an
36 | * incomplete conversion process of the original resource.
37 | *
38 | */
39 | String getId();
40 |
41 | /**
42 | * Sets the unique identifier of this UBY-LMF object.
43 | * @param id the unique identifier to set
44 | */
45 | void setId(String id);
46 | }
47 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/interfaces/IHasMonolingualExternalRefs.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.interfaces;
19 |
20 | import java.util.List;
21 |
22 | import de.tudarmstadt.ukp.lmf.model.semantics.MonolingualExternalRef;
23 |
24 | /**
25 | * Interface for UBY-LMF classes containing one or more
26 | * references to an external system, represented by {@link MonolingualExternalRef} instances.
27 | *
28 | * @author Zijad Maksuti
29 | *
30 | */
31 | public interface IHasMonolingualExternalRefs {
32 |
33 | /**
34 | * Returns the {@link List} of all {@link MonolingualExternalRef} instances which
35 | * link this UBY-LMF class instance to an external system.
36 | * @return the list of all monolingual external references of this UBY-LMF class instance or an empty
37 | * list if the instance does not have any monolingual external references set
38 | */
39 | List getMonolingualExternalRefs();
40 |
41 | /**
42 | * Sets the {@link List} of all {@link MonolingualExternalRef} instances to this
43 | * UBY-LMF class instance.
44 | * @param monolingualExternalRefs the monolingual external references to set
45 | */
46 | void setMonolingualExternalRefs(List monolingualExternalRefs);
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/interfaces/IHasParentSpecificTable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.interfaces;
19 |
20 | import de.tudarmstadt.ukp.lmf.model.core.TextRepresentation;
21 | import de.tudarmstadt.ukp.lmf.model.morphology.FormRepresentation;
22 |
23 | /**
24 | * Interface for UBY-LMF classes whose data will be stored in multiple
25 | * parent-specific tables. This should be the case for all entities that
26 | * are the target of more than one composition relations (i.e., they
27 | * appear has a child in multiple aggregation relations, but do not
28 | * stand for themselves). Practical examples are the
29 | * {@link FormRepresentation} and {@link TextRepresentation} classes
30 | * which are a child of multiple parent classes.
31 | * @author Christian M. Meyer
32 | */
33 | public interface IHasParentSpecificTable {
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/interfaces/IHasSemanticLabels.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.interfaces;
19 |
20 | import java.util.List;
21 |
22 | import de.tudarmstadt.ukp.lmf.model.meta.SemanticLabel;
23 |
24 | /**
25 | * Interface for Uby-LMF classes containing one or more semantic labels.
26 | *
27 | * @author Zijad Maksuti
28 | *
29 | */
30 | public interface IHasSemanticLabels {
31 |
32 | /**
33 | * Returns the list of all {@link SemanticLabel} instances attached to this
34 | * Uby-LMF class instance.
35 | * @return the list of all semantic labels attached to this Uby-LMF class instance
36 | * or an empty list, if the instance does not have any semantic labels attached
37 | */
38 | List getSemanticLabels();
39 |
40 | /**
41 | * Sets the {@link List} of all {@link SemanticLabel} instances attached to
42 | * this Uby-LMF class instance instance.
43 | * @param semanticLabels the list of all semantic labels to set
44 | */
45 | void setSemanticLabels(List semanticLabels);
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/interfaces/IHasTextRepresentations.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.interfaces;
19 |
20 | import java.util.List;
21 |
22 | import de.tudarmstadt.ukp.lmf.model.core.TextRepresentation;
23 |
24 | /**
25 | * Interface for UBY-LMF classes containing one or more
26 | * {@link TextRepresentation} instances.
27 | *
28 | * @author Zijad Maksuti
29 | *
30 | */
31 | public interface IHasTextRepresentations {
32 |
33 | /**
34 | * Returns all text representations of this Uby-LMF class instance
35 | * @return {@link List} of this Uby-LMF class instances text representations.
36 | * If the instance has no text representation, this method returns an empty list
37 | * @see TextRepresentation
38 | */
39 | List getTextRepresentations();
40 |
41 | /**
42 | * Sets a {@link List} of text representations to this Uby-LMF class instance instance.
43 | * @param textRepresentations the text representations to set
44 | * @see TextRepresentation
45 | */
46 | void setTextRepresentations(List textRepresentations);
47 |
48 | /** Returns the written text of all text representations. If there are
49 | * multiple text representations then a line break is used to separate
50 | * the individual written texts. */
51 | String getText();
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/miscellaneous/AccessType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.miscellaneous;
19 |
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | /**
26 | * Annotation type introduced for convenience reasons when converting
27 | * UBY-LMF to an XML-file. It specifies in which matter values of
28 | * class fields are read.
29 | *
30 | * By default, all fields are accessed using a canonical getter,
31 | * thus the default annotation is {@link EAccessType#GETTER}.
32 | *
33 | * @author Zijad Maksuti
34 | *
35 | */
36 | @Retention(RetentionPolicy.RUNTIME)
37 | @Target(ElementType.FIELD)
38 | public @interface AccessType {
39 | EAccessType type() default EAccessType.GETTER;
40 | }
41 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/miscellaneous/ConstraintSet.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.miscellaneous;
19 |
20 | import de.tudarmstadt.ukp.lmf.model.core.Lexicon;
21 |
22 | /**
23 | * This class represents a group of constraints
24 | * associated with a {@link Lexicon} instance.
25 | *
26 | * @author Zijad Maksuti
27 | *
28 | */
29 | public class ConstraintSet {
30 | // empty for now
31 | }
32 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/miscellaneous/EAccessType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.miscellaneous;
19 |
20 |
21 | /**
22 | * Enumeration of all access types used for the annotation
23 | * defined in {@link AccessType}.
24 | *
25 | * @author Zijad Maksuti
26 | *
27 | */
28 | public enum EAccessType {
29 | /**
30 | * The value of the field will be read using a canonical getter
31 | */
32 | GETTER,
33 |
34 | /**
35 | * The value of the field will be directly read
36 | */
37 | FIELD
38 | }
39 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/miscellaneous/EVarType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.miscellaneous;
19 |
20 |
21 | /**
22 | * Enumeration of all variable types used for the annotation
23 | * defined in {@link VarType}.
24 | *
25 | * @author Yevgen Chebotar
26 | *
27 | */
28 | public enum EVarType {
29 | ATTRIBUTE,
30 | ATTRIBUTE_OPTIONAL,
31 | CHILD,
32 | CHILDREN,
33 | IDREF,
34 | IDREFS,
35 | NONE
36 | }
37 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/miscellaneous/VarType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.miscellaneous;
19 |
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | /**
26 | * Annotation type introduced for convenience reasons when converting
27 | * Uby-LMF to an XML-file or to a database.
28 | * @author Yevgen Chebotar
29 | *
30 | */
31 | @Retention(RetentionPolicy.RUNTIME)
32 | @Target(ElementType.FIELD)
33 | public @interface VarType {
34 | EVarType type() default EVarType.NONE;
35 | }
36 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/main/java/de/tudarmstadt/ukp/lmf/model/semantics/SynsetRelation.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.semantics;
19 |
20 | import de.tudarmstadt.ukp.lmf.model.abstracts.SemanticRelation;
21 |
22 | /**
23 | * SynsetRelation is a class representing the oriented relationship between {@link Synset} instances.
24 | *
25 | * @author Zijad Maksuti
26 | *
27 | */
28 | public class SynsetRelation extends SemanticRelation{
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/test/java/de/tudarmstadt/ukp/lmf/model/core/LexicalEntryTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.core;
19 |
20 | import static org.junit.Assert.assertEquals;
21 |
22 | import org.junit.Before;
23 | import org.junit.Test;
24 |
25 | /**
26 | * Tests methods of {@link LexicalEntry} class
27 | *
28 | * @author Zijad Maksuti
29 | *
30 | */
31 | public class LexicalEntryTest {
32 |
33 | private LexicalEntry lexicalEntry;
34 |
35 | @Before
36 | public void setUp(){
37 | lexicalEntry = new LexicalEntry("l");
38 | }
39 |
40 | /**
41 | * Tests {@link #LexicalEntry(String)}
42 | */
43 | @Test
44 | public void testLexicalEntry(){
45 | String id = "2";
46 | lexicalEntry = new LexicalEntry(id);
47 | assertEquals(id, lexicalEntry.getId());
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/test/java/de/tudarmstadt/ukp/lmf/model/core/LexicalResourceTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.core;
19 |
20 | import static org.junit.Assert.*;
21 |
22 | import java.util.List;
23 |
24 | import org.junit.Before;
25 | import org.junit.Test;
26 |
27 | /**
28 | * Tests methods of {@link LexicalResource} class
29 | *
30 | * @author Zijad Maksuti
31 | *
32 | */
33 | public class LexicalResourceTest {
34 |
35 | private LexicalResource lexicalResource;
36 |
37 | @Before
38 | public void setUp(){
39 | lexicalResource = new LexicalResource();
40 | }
41 |
42 | /**
43 | * Tests {@link LexicalResource#addLexicon(Lexicon)}
44 | */
45 | @Test
46 | public void testAddLexicon() {
47 | Lexicon lexicon = new Lexicon();
48 | assertTrue(lexicalResource.addLexicon(lexicon));
49 | List lexicons = lexicalResource.getLexicons();
50 | assertEquals(1, lexicons.size());
51 | assertEquals(lexicon, lexicons.get(0));
52 | assertFalse(lexicalResource.addLexicon(lexicon));
53 | assertEquals(1, lexicons.size());
54 | Lexicon lexicon2 = new Lexicon();
55 | assertTrue(lexicalResource.addLexicon(lexicon2));
56 | assertEquals(2, lexicons.size());
57 | assertTrue(lexicons.contains(lexicon));
58 | assertTrue(lexicons.contains(lexicon2));
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/test/java/de/tudarmstadt/ukp/lmf/model/core/LexiconTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.core;
19 |
20 | import static org.junit.Assert.*;
21 |
22 | import java.util.List;
23 |
24 | import org.junit.Before;
25 | import org.junit.Test;
26 |
27 | /**
28 | * Tests methods of {@link Lexicon} class
29 | *
30 | * @author Zijad Maksuti
31 | *
32 | * @since UBY 0.2.0
33 | *
34 | */
35 | public class LexiconTest {
36 |
37 | private Lexicon lexicon;
38 |
39 | @Before
40 | public void setUp(){
41 | lexicon = new Lexicon();
42 | }
43 |
44 | /**
45 | * Tests {@link Lexicon#addLexicalEntry(LexicalEntry)}
46 | */
47 | @Test
48 | public void testAddLexicalEntry() {
49 | LexicalEntry lexicalEntry = new LexicalEntry("1");
50 | assertTrue(lexicon.addLexicalEntry(lexicalEntry));
51 | List lexicalEntries = lexicon.getLexicalEntries();
52 |
53 | assertEquals(1, lexicalEntries.size());
54 | assertEquals(lexicalEntry, lexicalEntries.get(0));
55 | assertFalse(lexicon.addLexicalEntry(lexicalEntry));
56 | assertEquals(1, lexicalEntries.size());
57 | LexicalEntry lexicalEntry2 = new LexicalEntry("2");
58 | assertTrue(lexicon.addLexicalEntry(lexicalEntry2));
59 | assertEquals(2, lexicalEntries.size());
60 | assertTrue(lexicalEntries.contains(lexicalEntry));
61 | assertTrue(lexicalEntries.contains(lexicalEntry2));
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/test/java/de/tudarmstadt/ukp/lmf/model/core/SenseTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.core;
19 |
20 | import static org.junit.Assert.assertEquals;
21 | import static org.junit.Assert.assertNull;
22 |
23 | import org.junit.Test;
24 |
25 | /**
26 | * Tests methods of {@link Sense} class
27 | *
28 | * @author Zijad Maksuti
29 | *
30 | * @since UBY 0.2.0
31 | */
32 | public class SenseTest {
33 |
34 | /**
35 | * Tests the {@link Sense#Sense()} constructor.
36 | */
37 | @Test
38 | public void testSense(){
39 | Sense sense = new Sense();
40 | assertNull(sense.getId());
41 | // TODO check other fields
42 | }
43 |
44 | /**
45 | * Tests the {@link Sense#Sense(String)} constructor.
46 | */
47 | @Test
48 | public void testSenseWithId(){
49 | String senseId = "senseId";
50 | Sense sense = new Sense(senseId);
51 | assertEquals(senseId, sense.getId());
52 | // TODO check other fields
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/test/java/de/tudarmstadt/ukp/lmf/model/semantics/SemanticArgumentTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.semantics;
19 |
20 | import static org.junit.Assert.assertEquals;
21 | import static org.junit.Assert.assertNull;
22 |
23 | import org.junit.Test;
24 |
25 | /**
26 | * Tests methods of {@link SemanticArgument} class
27 | *
28 | * @author Zijad Maksuti
29 | *
30 | * @since UBY 0.2.0
31 | */
32 | public class SemanticArgumentTest {
33 |
34 | /**
35 | * Tests the {@link SemanticArgument#SemanticArgument()} constructor.
36 | */
37 | @Test
38 | public void testSemanticArgument(){
39 | SemanticArgument semanticArgument = new SemanticArgument();
40 | assertNull(semanticArgument.getId());
41 | // TODO check other fields
42 | }
43 |
44 | /**
45 | * Tests the {@link SemanticArgument#SemanticArgument(String)} constructor.
46 | */
47 | @Test
48 | public void testSemanticArgumentWithId(){
49 | String semArgId = "semArgId";
50 | SemanticArgument semArg = new SemanticArgument(semArgId);
51 | assertEquals(semArgId, semArg.getId());
52 | // TODO check other fields
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.lmf.model-asl/src/test/java/de/tudarmstadt/ukp/lmf/model/semantics/SynsetTest.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 | package de.tudarmstadt.ukp.lmf.model.semantics;
19 |
20 | import static org.junit.Assert.assertEquals;
21 | import static org.junit.Assert.assertNull;
22 |
23 | import org.junit.Test;
24 |
25 | import de.tudarmstadt.ukp.lmf.model.semantics.Synset;
26 |
27 | /**
28 | * Tests methods of {@link Synset} class
29 | *
30 | * @author Zijad Maksuti
31 | *
32 | * @since UBY 0.2.0
33 | */
34 | public class SynsetTest {
35 |
36 | /**
37 | * Tests the {@link Synset#Synset()} constructor.
38 | */
39 | @Test
40 | public void testSynset(){
41 | Synset synset = new Synset();
42 | assertNull(synset.getId());
43 | // TODO check other fields
44 | }
45 |
46 | /**
47 | * Tests the {@link Synset#Synset(String)} constructor.
48 | */
49 | @Test
50 | public void testSynsetWithId(){
51 | String synsetId = "synsetId";
52 | Synset synset = new Synset(synsetId);
53 | assertEquals(synsetId, synset.getId());
54 | // TODO check other fields
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.persistence.lmfxml-asl/.activate_rat-check:
--------------------------------------------------------------------------------
1 | Trigger to activate the "rat-check" profile in the parent POM.
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.persistence.lmfxml-asl/src/main/java/de/tudarmstadt/ukp/lmf/writer/LMFWriter.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 |
19 | package de.tudarmstadt.ukp.lmf.writer;
20 |
21 | /** @deprecated THIS CLASS WILL BE REMOVED SOON. USE MODULE persistence.transform INSTEAD! */
22 | @Deprecated
23 | public abstract class LMFWriter {
24 | public abstract void writeElement(Object lmfObject) throws LMFWriterException;
25 | public abstract void writeStartElement(Object lmfObject) throws LMFWriterException;
26 | public abstract void writeEndElement(Object lmfObject) throws LMFWriterException;
27 | public abstract void writeEndDocument() throws LMFWriterException;
28 | }
29 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.persistence.lmfxml-asl/src/main/java/de/tudarmstadt/ukp/lmf/writer/LMFWriterException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 |
19 | package de.tudarmstadt.ukp.lmf.writer;
20 |
21 | /**
22 | * This exception should be thrown by all {@link LMFWriter} instances and can be used
23 | * as a wrapper.
24 | *
25 | * @author Yevgen Chebotar
26 | * @since UBY 0.1.0
27 | * @deprecated THIS CLASS WILL BE REMOVED SOON. USE MODULE persistence.transform INSTEAD!
28 | */
29 | @Deprecated
30 | public class LMFWriterException extends Exception {
31 |
32 | private static final long serialVersionUID = 3656613135105045894L;
33 |
34 | public LMFWriterException(Throwable cause) {
35 | super(cause);
36 | }
37 |
38 | public LMFWriterException(){
39 | super();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.persistence.transform-asl/.activate_rat-check:
--------------------------------------------------------------------------------
1 | Trigger to activate the "rat-check" profile in the parent POM.
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.persistence.transform-asl/pom.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 | 4.0.0
20 |
21 | de.tudarmstadt.ukp.uby
22 | de.tudarmstadt.ukp.uby
23 | 0.8.0-SNAPSHOT
24 |
25 | de.tudarmstadt.ukp.uby.persistence.transform-asl
26 | Persistence: Streaming Import/Export
27 |
28 |
29 | Apache License Version 2.0
30 | http://www.apache.org/licenses/LICENSE-2.0.txt
31 |
32 |
33 |
34 |
35 | de.tudarmstadt.ukp.uby
36 | de.tudarmstadt.ukp.uby.lmf.model-asl
37 |
38 |
39 | de.tudarmstadt.ukp.uby
40 | de.tudarmstadt.ukp.uby.persistence.lmfxml-asl
41 |
42 |
43 | de.tudarmstadt.ukp.uby
44 | de.tudarmstadt.ukp.uby.lmf.api-asl
45 |
46 |
47 | junit
48 | junit
49 | test
50 |
51 |
52 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.testing-asl/.activate_rat-check:
--------------------------------------------------------------------------------
1 | Trigger to activate the "rat-check" profile in the parent POM.
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.testing-asl/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 | 4.0.0
21 |
22 | de.tudarmstadt.ukp.uby
23 | de.tudarmstadt.ukp.uby
24 | 0.8.0-SNAPSHOT
25 |
26 | de.tudarmstadt.ukp.uby.testing-asl
27 | Testing: API testing with in-memory DB
28 |
29 |
30 | Apache License Version 2.0
31 | http://www.apache.org/licenses/LICENSE-2.0.txt
32 |
33 |
34 |
35 |
36 |
37 | de.tudarmstadt.ukp.uby
38 | de.tudarmstadt.ukp.uby.lmf.model-asl
39 |
40 |
41 | de.tudarmstadt.ukp.uby
42 | de.tudarmstadt.ukp.uby.persistence.transform-asl
43 |
44 |
45 | de.tudarmstadt.ukp.uby
46 | de.tudarmstadt.ukp.uby.lmf.api-asl
47 |
48 |
49 | com.h2database
50 | h2
51 | 1.3.160
52 | jar
53 | compile
54 |
55 |
56 | junit
57 | junit
58 |
59 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.ubycreate-gpl/.activate_license-check:
--------------------------------------------------------------------------------
1 | Copyright ${year}
2 | Ubiquitous Knowledge Processing (UKP) Lab
3 | Technische Universität Darmstadt
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program. If not, see .
17 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.ubycreate-gpl/src/main/java/de/tudarmstadt/ukp/uby/ubycreate/Creator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 | package de.tudarmstadt.ukp.uby.ubycreate;
20 |
21 | import java.io.File;
22 |
23 | import de.tudarmstadt.ukp.lmf.transform.DBConfig;
24 |
25 | public interface Creator
26 | {
27 | public File lexicon2XML(String source, File lmfXML)
28 | throws Exception;
29 |
30 | public void lexicon2DB(DBConfig dbConfig, String source)
31 | throws Exception;
32 | }
33 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.ubycreate-gpl/src/main/java/de/tudarmstadt/ukp/uby/ubycreate/XMLCreator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 | package de.tudarmstadt.ukp.uby.ubycreate;
20 |
21 | import java.io.File;
22 |
23 | import org.dom4j.DocumentException;
24 |
25 | import de.tudarmstadt.ukp.lmf.transform.DBConfig;
26 | import de.tudarmstadt.ukp.lmf.transform.XMLToDBTransformer;
27 |
28 | public class XMLCreator
29 | implements Creator
30 | {
31 |
32 | /**
33 | * This method store the data from the XML file in UBY format into DB
34 | *
35 | */
36 | @Override
37 | public void lexicon2DB(DBConfig dbConfig, String source)
38 | throws DocumentException
39 | {
40 | String lexicalName = "xml";
41 | System.out.println("xml2db: " + source + " -> " + dbConfig.getJdbc_url());
42 |
43 | File lmfXML = new File(source);
44 |
45 | /* Persisting lmfXML into DB */
46 |
47 | XMLToDBTransformer xmlToDB = new XMLToDBTransformer(dbConfig);
48 | xmlToDB.transform(lmfXML, lexicalName);
49 | }
50 |
51 | @Override
52 | public File lexicon2XML(String source, File lmfXML)
53 | throws Exception
54 | {
55 | return lmfXML;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.ubycreate-gpl/src/test/java/de/tudarmstadt/ukp/uby/AppTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * This program is free software: you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation, either version 3 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This program is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program. If not, see .
18 | */
19 | package de.tudarmstadt.ukp.uby;
20 |
21 | import junit.framework.Test;
22 | import junit.framework.TestCase;
23 | import junit.framework.TestSuite;
24 |
25 | /**
26 | * Unit test for simple App.
27 | */
28 | public class AppTest
29 | extends TestCase
30 | {
31 | /**
32 | * Create the test case
33 | *
34 | * @param testName name of the test case
35 | */
36 | public AppTest( String testName )
37 | {
38 | super( testName );
39 | }
40 |
41 | /**
42 | * @return the suite of tests being tested
43 | */
44 | public static Test suite()
45 | {
46 | return new TestSuite( AppTest.class );
47 | }
48 |
49 | /**
50 | * Rigourous Test :-)
51 | */
52 | public void testApp()
53 | {
54 | assertTrue( true );
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.uima-asl/.activate_rat-check:
--------------------------------------------------------------------------------
1 | Trigger to activate the "rat-check" profile in the parent POM.
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.uima-asl/src/main/java/de/tudarmstadt/ukp/uby/resource/package-info.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 |
19 | /**
20 | * @author Judith Eckle-Kohler
21 | *
22 | * UIMA resources based on UBY
23 | *
24 | */
25 | package de.tudarmstadt.ukp.uby.resource;
--------------------------------------------------------------------------------
/de.tudarmstadt.ukp.uby.uima-asl/src/main/java/de/tudarmstadt/ukp/uby/uima/annotator/package-info.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright 2017
3 | * Ubiquitous Knowledge Processing (UKP) Lab
4 | * Technische Universität Darmstadt
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | ******************************************************************************/
18 |
19 | /**
20 | *
21 | * Interface to UIMA-based processing with Uby as ExternalResource
22 | *
23 | *
24 | */
25 | package de.tudarmstadt.ukp.uby.uima.annotator;
--------------------------------------------------------------------------------