-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from JuliaText/ox/0.6
Ox/0.6
- Loading branch information
Showing
11 changed files
with
133 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
julia 0.5- | ||
julia 0.6 | ||
LightXML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,76 @@ | ||
using Base.Test | ||
using CorpusLoaders | ||
|
||
|
||
eg1 = """ | ||
<?xml version="1.0" encoding="iso-8859-1" ?> | ||
<!DOCTYPE corpus SYSTEM "coarse-all-words.dtd"> | ||
<corpus lang="en"> | ||
<text id="d001"> | ||
<sentence id="d001.s001"> | ||
A | ||
B | ||
<instance id="d001.s001.t001" lemma="editorial" pos="n">editorial</instance> | ||
`` | ||
C | ||
<instance id="d001.s001.t002" lemma="Ill" pos="a">Ill</instance> | ||
<instance id="d001.s001.t003" lemma="Homeless" pos="n">Homeless</instance> | ||
. | ||
D | ||
</sentence> | ||
</text> | ||
</corpus> | ||
"""; | ||
|
||
eg2 = """ | ||
<?xml version="1.0" encoding="iso-8859-1" ?> | ||
<!DOCTYPE corpus SYSTEM "coarse-all-words.dtd"> | ||
<corpus lang="en"> | ||
<text id="d001"> | ||
<sentence id="d001.s001"> | ||
A | ||
B | ||
<instance id="d001.s001.t001" lemma="editorial" pos="n">1</instance> | ||
C | ||
D | ||
</sentence> | ||
</text> | ||
<text> | ||
<sentence id="d001.s001"> | ||
<instance id="d001.s001.t001" lemma="editorial" pos="n">2</instance> | ||
A1 | ||
B2 | ||
C2 | ||
D3 | ||
</sentence> | ||
</text> | ||
</corpus> | ||
"""; | ||
|
||
@testset "sentence" begin | ||
r1 = load_challenges_semeval2007t7(IOBuffer(eg1)) | ||
@test length(r1) == 3 | ||
|
||
r2 = load_challenges_semeval2007t7(IOBuffer(eg2)) | ||
@test length(r2) == 2 | ||
@test length(first(r2).context) == 5 | ||
@test length(last(r2).context) == 5 | ||
@test first(r2) != last(r2) | ||
end | ||
|
||
@testset "windowing" begin | ||
eg1 = """ | ||
<?xml version="1.0" encoding="iso-8859-1" ?> | ||
<!DOCTYPE corpus SYSTEM "coarse-all-words.dtd"> | ||
<corpus lang="en"> | ||
<text id="d001"> | ||
<sentence id="d001.s001"> | ||
A | ||
B | ||
<instance id="d001.s001.t001" lemma="editorial" pos="n">editorial</instance> | ||
`` | ||
C | ||
<instance id="d001.s001.t002" lemma="Ill" pos="a">Ill</instance> | ||
<instance id="d001.s001.t003" lemma="Homeless" pos="n">Homeless</instance> | ||
. | ||
D | ||
</sentence> | ||
</text> | ||
</corpus> | ||
"""; | ||
r1 = lazyload_challenges_semeval2007t7(IOBuffer(eg1), 10, x->!isalnum(x)) |> collect | ||
r1 = lazyload_challenges_semeval2007t7(IOBuffer(eg1), 10, x->!all(isalnum, x)) |> collect | ||
|
||
|
||
@test length(r1) == 3 | ||
@test r1[1].context ==["A","B","C", "Ill","Homeless","D"] | ||
@test r1[1].word == "editorial" | ||
|
||
|
||
|
||
eg2 = """ | ||
<?xml version="1.0" encoding="iso-8859-1" ?> | ||
<!DOCTYPE corpus SYSTEM "coarse-all-words.dtd"> | ||
<corpus lang="en"> | ||
<text id="d001"> | ||
<sentence id="d001.s001"> | ||
A | ||
B | ||
<instance id="d001.s001.t001" lemma="editorial" pos="n">1</instance> | ||
C | ||
D | ||
</sentence> | ||
</text> | ||
<text> | ||
<sentence id="d001.s001"> | ||
<instance id="d001.s001.t001" lemma="editorial" pos="n">2</instance> | ||
A1 | ||
B2 | ||
C2 | ||
D3 | ||
</sentence> | ||
</text> | ||
</corpus> | ||
"""; | ||
r2 = lazyload_challenges_semeval2007t7(IOBuffer(eg2), 10, x->!isalnum(x)) |> collect | ||
r2 = lazyload_challenges_semeval2007t7(IOBuffer(eg2), 10) |> collect | ||
|
||
|
||
@test r2[1].context ==["A","B","C","D"] | ||
@test r2[2].context ==["A1","B2","C2","D3"] | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
using Base.Test | ||
using CorpusLoaders | ||
|
||
|
||
@testset "wordsim353" begin | ||
egs = """Word 1,Word 2,Human (mean) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
@test brownPOStoWordNetPOS("NP") == 'n' | ||
@test brownPOStoWordNetPOS("JJ") == 'a' | ||
using Base.Test | ||
using CorpusLoaders | ||
|
||
@test brownPOStoWordNetPOS("NP") == 'n' | ||
@test brownPOStoWordNetPOS("JJ") == 'a' | ||
|
||
@test pennPOStoWordNetPOS("NNP") == 'n' | ||
@test pennPOStoWordNetPOS("JJ") == 'a' | ||
|
||
@test pennPOStoWordNetPOS("NNP") == 'n' | ||
@test pennPOStoWordNetPOS("JJ") == 'a' |
Oops, something went wrong.