Skip to content

Commit bcd46c4

Browse files
author
Lyndon White
committed
=rename
1 parent 9e6d6d7 commit bcd46c4

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The StringInterning.jl package is licensed under the MIT "Expat" License:
1+
The InternedStrings.jl package is licensed under the MIT "Expat" License:
22

33
> Copyright (c) 2017: Lyndon White.
44
> Copyright (c) 2009-2016: Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and other contributors: https://github.com/JuliaLang/julia/contributors

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# StringInterning
1+
# InternedStrings
22

33
String interning in julia.
44
For not having duplicate strings in memory.
55

6-
[![Build Status](https://travis-ci.org/oxinabox/StringInterning.jl.svg?branch=master)](https://travis-ci.org/oxinabox/StringInterning.jl)
6+
[![Build Status](https://travis-ci.org/oxinabox/InternedStrings.jl.svg?branch=master)](https://travis-ci.org/oxinabox/InternedStrings.jl)
77

88
## Usage
99

@@ -27,7 +27,7 @@ But it is a bit too breaking.
2727

2828
SubStrings and InternedStrings solve roughly the same problem.
2929
But with different techniques and trade-offs.
30-
If you are using StringInterning you probably don't want a substring anywhere.
30+
If you are using InternedStrings you probably don't want a substring anywhere.
3131
Since you might mistakenly end-up holding on to a really big string.
3232
The very problem this is designed to avoid.
3333

@@ -150,7 +150,7 @@ Which requires writing more manual memory management (at least reference countin
150150
than I want to do.
151151
But like even 16 bit pointers (65,536) are probably just enough for most NLP tasks.
152152

153-
One thing to do is to use (on-top of StringInterning.jl), [MLLabelUtils.jl](https://github.com/JuliaML/MLLabelUtils.jl) and encode your strings as Ints.
153+
One thing to do is to use (on-top of InternedStrings.jl), [MLLabelUtils.jl](https://github.com/JuliaML/MLLabelUtils.jl) and encode your strings as Ints.
154154

155155

156156

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ build_script:
4141
# Need to convert from shallow to complete for Pkg.clone to work
4242
- IF EXIST .git\shallow (git fetch --unshallow)
4343
- C:\projects\julia\bin\julia -e "versioninfo();
44-
Pkg.clone(pwd(), \"StringInterning\"); Pkg.build(\"StringInterning\")"
44+
Pkg.clone(pwd(), \"InternedStrings\"); Pkg.build(\"InternedStrings\")"
4545

4646
test_script:
47-
- C:\projects\julia\bin\julia -e "Pkg.test(\"StringInterning\")"
47+
- C:\projects\julia\bin\julia -e "Pkg.test(\"InternedStrings\")"

src/StringInterning.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module StringInterning
1+
module InternedStrings
22
using Base
33

44
export InternedString, @i_str

test/corefunctionality.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using StringInterning
1+
using InternedStrings
22
using Base.Test
33

44
"This function makes use of `xs` in a way no optimizer can possibly remove"
@@ -9,7 +9,7 @@ function use(xs...)
99
end
1010

1111
@testset "Basic String Functionality" begin let
12-
empty!(StringInterning.pool)
12+
empty!(InternedStrings.pool)
1313

1414
s = InternedString("Hello My Friends1")
1515

@@ -25,7 +25,7 @@ end end
2525

2626

2727
@testset "Interning" begin let
28-
empty!(StringInterning.pool)
28+
empty!(InternedStrings.pool)
2929
a = "Hello My Friends2"
3030
b = join(["Hello", "My", "Friends2"], " ")
3131
@test !(a===b) # sanity check that strings are not already Interning
@@ -63,41 +63,41 @@ end end
6363

6464

6565
@testset "Garbage Collection 1" begin let
66-
empty!(StringInterning.pool)
67-
@test length(StringInterning.pool)==0
66+
empty!(InternedStrings.pool)
67+
@test length(InternedStrings.pool)==0
6868
ai = InternedString("Hello My Friends3")
6969
ai = [44] #remove the reference
7070
gc();
71-
@test 0<=length(StringInterning.pool)<=1 #May or may not have been collected yet
71+
@test 0<=length(InternedStrings.pool)<=1 #May or may not have been collected yet
7272
end end
7373

7474
@testset "Garbage Collection 2" begin let
75-
empty!(StringInterning.pool)
76-
@test length(StringInterning.pool)==0
75+
empty!(InternedStrings.pool)
76+
@test length(InternedStrings.pool)==0
7777
ai = InternedString("Hello My Friends4")
7878
bi = InternedString(join(["Hello", "My", "Friends4"], " "))
7979
@test ai.value === bi.value
80-
@test length(StringInterning.pool)==1
80+
@test length(InternedStrings.pool)==1
8181
use(ai,bi)
8282
ai = [44]
8383
gc()
84-
@test length(StringInterning.pool)==1 #don't collect when only one reference is gone
84+
@test length(InternedStrings.pool)==1 #don't collect when only one reference is gone
8585
use(bi)
8686
bi=[32]
8787
gc()
88-
@test 0<=length(StringInterning.pool)<=1
88+
@test 0<=length(InternedStrings.pool)<=1
8989
end end
9090

9191

9292

9393
srand(1)
9494
@testset "Garbage Collection stress test" begin let
95-
empty!(StringInterning.pool)
96-
oldpoolsize = length(StringInterning.pool)
95+
empty!(InternedStrings.pool)
96+
oldpoolsize = length(InternedStrings.pool)
9797
function checkpool(op)
9898
gc()
99-
@test op(length(StringInterning.pool), oldpoolsize)
100-
oldpoolsize = length(StringInterning.pool)
99+
@test op(length(InternedStrings.pool), oldpoolsize)
100+
oldpoolsize = length(InternedStrings.pool)
101101
end
102102

103103
originals = [randstring(rand(1:1024)) for _ in 1:10^5]
@@ -124,5 +124,5 @@ srand(1)
124124
end
125125

126126
# This one matters:
127-
@test length(StringInterning.pool) < n_orginals
127+
@test length(InternedStrings.pool) < n_orginals
128128
end end

test/operations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Base.Test
2-
using StringInterning
2+
using InternedStrings
33

44
macro testtype(ex)
55
:(@test typeof($ex) == InternedString) |>esc

0 commit comments

Comments
 (0)