Intl.Segmenter
Webbläsarstöd
Fullt stöd
Webbläsarstöd
Fullt stöd
Tillgänglig i Chrome från version 87 Chrome
Tillgänglig i Edge från version 87 Edge
Tillgänglig i Firefox från version 125 Firefox
Tillgänglig i Opera från version 73 Opera
Tillgänglig i Safari från version 14.1 Safari
Tillgänglig i Chrome Android från version 87 Chrome Android
Tillgänglig i Firefox for Android från version 125 Firefox for Android
Tillgänglig i Opera Android från version 62 Opera Android
Tillgänglig i Safari on iOS från version 14.5 Safari on iOS
Tillgänglig i Samsung Internet från version 14.0 Samsung Internet
Tillgänglig i WebView Android från version 87 WebView Android
Tillgänglig i WebView on iOS från version 14.5 WebView on iOS
Tillgänglig i Deno från version 1.8 Deno
Tillgänglig i Node.js från version 16.0.0 Node.js
Indata
Utdata
granularity
{
granularity: "word"
}
[
{
"segment": "This",
"index": 0,
"input": "This is a sentence.",
"isWordLike": true
},
{
"segment": " ",
"index": 4,
"input": "This is a sentence.",
"isWordLike": false
},
{
"segment": "is",
"index": 5,
"input": "This is a sentence.",
"isWordLike": true
},
{
"segment": " ",
"index": 7,
"input": "This is a sentence.",
"isWordLike": false
},
{
"segment": "a",
"index": 8,
"input": "This is a sentence.",
"isWordLike": true
},
{
"segment": " ",
"index": 9,
"input": "This is a sentence.",
"isWordLike": false
},
{
"segment": "sentence",
"index": 10,
"input": "This is a sentence.",
"isWordLike": true
},
{
"segment": ".",
"index": 18,
"input": "This is a sentence.",
"isWordLike": false
}
]
{
granularity: "sentence"
}
[
{
"segment": "This is a sentence.",
"index": 0,
"input": "This is a sentence."
}
]
{
granularity: "grapheme"
}
[
{
"segment": "T",
"index": 0,
"input": "This is a sentence."
},
{
"segment": "h",
"index": 1,
"input": "This is a sentence."
},
{
"segment": "i",
"index": 2,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 3,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 4,
"input": "This is a sentence."
},
{
"segment": "i",
"index": 5,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 6,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 7,
"input": "This is a sentence."
},
{
"segment": "a",
"index": 8,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 9,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 10,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 11,
"input": "This is a sentence."
},
{
"segment": "n",
"index": 12,
"input": "This is a sentence."
},
{
"segment": "t",
"index": 13,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 14,
"input": "This is a sentence."
},
{
"segment": "n",
"index": 15,
"input": "This is a sentence."
},
{
"segment": "c",
"index": 16,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 17,
"input": "This is a sentence."
},
{
"segment": ".",
"index": 18,
"input": "This is a sentence."
}
]
localeMatcher
{
localeMatcher: "best fit"
}
[
{
"segment": "T",
"index": 0,
"input": "This is a sentence."
},
{
"segment": "h",
"index": 1,
"input": "This is a sentence."
},
{
"segment": "i",
"index": 2,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 3,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 4,
"input": "This is a sentence."
},
{
"segment": "i",
"index": 5,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 6,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 7,
"input": "This is a sentence."
},
{
"segment": "a",
"index": 8,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 9,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 10,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 11,
"input": "This is a sentence."
},
{
"segment": "n",
"index": 12,
"input": "This is a sentence."
},
{
"segment": "t",
"index": 13,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 14,
"input": "This is a sentence."
},
{
"segment": "n",
"index": 15,
"input": "This is a sentence."
},
{
"segment": "c",
"index": 16,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 17,
"input": "This is a sentence."
},
{
"segment": ".",
"index": 18,
"input": "This is a sentence."
}
]
{
localeMatcher: "lookup"
}
[
{
"segment": "T",
"index": 0,
"input": "This is a sentence."
},
{
"segment": "h",
"index": 1,
"input": "This is a sentence."
},
{
"segment": "i",
"index": 2,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 3,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 4,
"input": "This is a sentence."
},
{
"segment": "i",
"index": 5,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 6,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 7,
"input": "This is a sentence."
},
{
"segment": "a",
"index": 8,
"input": "This is a sentence."
},
{
"segment": " ",
"index": 9,
"input": "This is a sentence."
},
{
"segment": "s",
"index": 10,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 11,
"input": "This is a sentence."
},
{
"segment": "n",
"index": 12,
"input": "This is a sentence."
},
{
"segment": "t",
"index": 13,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 14,
"input": "This is a sentence."
},
{
"segment": "n",
"index": 15,
"input": "This is a sentence."
},
{
"segment": "c",
"index": 16,
"input": "This is a sentence."
},
{
"segment": "e",
"index": 17,
"input": "This is a sentence."
},
{
"segment": ".",
"index": 18,
"input": "This is a sentence."
}
]